Remove Controls from Rich Text Editor Ribbon Bar Backstage View

7 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    22 posts
    Member since:
    Jan 2016

    Posted 01 Apr 2016 Link to this post

    Hi,

    How do I remove/hide buttons specifically 

    • Html Document 
    • Rich Text Format
    • Plain Text
    • XAML Document

    from the backstage view of the Rich Text Editor Ribbon Bar.

    With a regular backstage view I could do something along the lines of

    this.radRibbonBarBackstageView1.Controls.Remove(this.radButton1);

    but here I can't access the backstage view.

     

    picture

     

    Thank you in advance

    Mohammed

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3276 posts

    Posted 05 Apr 2016 Link to this post

    Hello Mohammed,

    Thank you for writing.

    In order to hide the described buttons you can use the following code snippet:
    public Form1()
    {
        InitializeComponent();
        CustomRichTextEditorRibbonBar ribbonUI = new CustomRichTextEditorRibbonBar();
        this.Controls.Add(ribbonUI);
    }
     
    public class CustomRichTextEditorRibbonBar : RichTextEditorRibbonBar
    {
        protected override void Initialize()
        {
            base.Initialize();
            this.buttonSaveHTML.Visible = false;
            this.buttonSavePlain.Visible = false;
            this.buttonSaveRich.Visible = false;
            this.buttonXAML.Visible = false;
        }
    }

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. Mohammed
    Mohammed avatar
    22 posts
    Member since:
    Jan 2016

    Posted 06 Apr 2016 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you very much. This works awesome. :)
  4. Christian
    Christian avatar
    2 posts
    Member since:
    Nov 2018

    Posted 19 Dec 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    This is not working for me. The code snippit does not throw an error, but the buttons are still visible.
  5. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 20 Dec 2018 Link to this post

    Hi Christian,

    The suggested approach is working well on my end. I am attaching my test project and a screenshot showing the result.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  6. Christian
    Christian avatar
    2 posts
    Member since:
    Nov 2018

    Posted 20 Dec 2018 in reply to Hristo Link to this post

    Thanks Hristo. I downloaded your solution, but I have 5-errors. Please see the attached.

     

    Thanks,

    Christian

  7. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 21 Dec 2018 Link to this post

    Hello Christian,

    As I have replied in the support ticket on the same matter, I am attaching the updated project featuring one more approach to hide the save buttons: 
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
     
        }
     
        private void button1_Click(object sender, EventArgs e)
        {
            BackstageTabItem saveAsItem = this.richTextEditorRibbonBar1.RibbonBarElement.BackstageControl.Items["backstageTabItemSaveAs"] as BackstageTabItem;
            BackstageViewPage page = saveAsItem.Page;
            page.Controls[0].Controls["buttonSaveHTML"].Visible = false;
            page.Controls[0].Controls["buttonSavePlain"].Visible = false;
            page.Controls[0].Controls["buttonSaveRich"].Visible = false;
            page.Controls[0].Controls["buttonXAML"].Visible = false;
        }
    }

    About the errors in the attached screenshot, please delete the license file as it conflicts with your actual version: https://docs.telerik.com/devtools/winforms/licensing/license-file-(licx). Let me know if you have managed to hide the buttons.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top