Beispiel #1
0
        protected void ASPxRichEdit1_Init(object sender, EventArgs e)
        {
            ASPxRichEdit richEdit = (ASPxRichEdit)sender;

            richEdit.CreateDefaultRibbonTabs(true);

            //Hide Mail Merge Tab
            richEdit.RibbonTabs.Find(tab => tab.Text == "Mail Merge").Visible = false;

            //Hide Page Layout Tab
            richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Visible = false;

            //Hide File Tab
            richEdit.RibbonTabs.Find(tab => tab.Text == "File").Visible = false;

            //Hide Group Buttons by Name
            richEdit.RibbonTabs.Find(tab => tab.Text == "Insert").Groups.Find(group => group.Text == "Pages").Visible           = false;
            richEdit.RibbonTabs.Find(tab => tab.Text == "Insert").Groups.Find(group => group.Text == "Illustrations").Visible   = false;
            richEdit.RibbonTabs.Find(tab => tab.Text == "Insert").Groups.Find(group => group.Text == "Header & Footer").Visible = false;
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Background").Visible = false;
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Page Setup").Visible = false;

            //Hide Page Layout Buttons by Name Id it is not working well
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Page Setup").Items[0].Visible = false;
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Page Setup").Items[1].Visible = false;
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Page Setup").Items[2].Visible = false;
            //richEdit.RibbonTabs.Find(tab => tab.Text == "Page Layout").Groups.Find(group => group.Text == "Page Setup").Items[3].Visible = false;

            //Hide Page Layout Buttons by Index Id it is not working well
            //richEdit.RibbonTabs[3].Groups[1].Items[0].Visible = false;
            //richEdit.RibbonTabs[3].Groups[0].Items[0].Visible = false;
            //richEdit.RibbonTabs[3].Groups[0].Items[1].Visible = false;
            //richEdit.RibbonTabs[3].Groups[0].Items[2].Visible = false;
            //richEdit.RibbonTabs[3].Groups[0].Items[3].Visible = false;

            //Disable Header and Footer
            //richEdit.Settings.DocumentCapabilities.HeadersFooters = DevExpress.XtraRichEdit.DocumentCapability.Disabled;

            //Hide Bookmark
            richEdit.Settings.DocumentCapabilities.Bookmarks = DevExpress.XtraRichEdit.DocumentCapability.Hidden;

            //Hide Hyperlink
            richEdit.Settings.DocumentCapabilities.Hyperlinks = DevExpress.XtraRichEdit.DocumentCapability.Hidden;

            //Hide buttons
            richEdit.Settings.Behavior.SaveAs    = DevExpress.XtraRichEdit.DocumentCapability.Hidden;
            richEdit.Settings.Behavior.Open      = DevExpress.XtraRichEdit.DocumentCapability.Hidden;
            richEdit.Settings.Behavior.CreateNew = DevExpress.XtraRichEdit.DocumentCapability.Hidden;

            // Show Confirmation Message
            richEdit.ShowConfirmOnLosingChanges = false;

            // Definitions Page
            //RichEditDocumentServer server = new RichEditDocumentServer();
            //server.Document.Sections[0].Page.PaperKind = System.Drawing.Printing.PaperKind.A4;
        }
        public static void HideFileTab(ASPxRichEdit richEdit)
        {
            richEdit.CreateDefaultRibbonTabs(true);
            richEdit.RibbonTabs.RemoveAt(0);
            RERFileCommonGroup gr = new RERFileCommonGroup();

            gr.Items.Add(new RERSaveCommand());
            gr.Items.Add(new RERPrintCommand());
            richEdit.RibbonTabs[0].Groups.Insert(0, gr);
            richEdit.ActiveTabIndex = 0;
        }
Beispiel #3
0
 public static void HideFileTab(ASPxRichEdit richedit)
 {
     richedit.CreateDefaultRibbonTabs(true);
     RemoveRibbonTab(richedit.RibbonTabs, typeof(RERFileTab));
     richedit.ActiveTabIndex = 0;
 }