This is a migrated thread and some comments may be shown as answers.

Remove Controls from Rich Text Editor Ribbon Bar Backstage View

6 Answers 924 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Mohammed
Top achievements
Rank 1
Mohammed asked on 01 Apr 2016, 04:38 PM

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

6 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Apr 2016, 11:04 AM
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.
0
Mohammed
Top achievements
Rank 1
answered on 06 Apr 2016, 01:47 PM
Thank you very much. This works awesome. :)
0
Christian
Top achievements
Rank 1
answered on 19 Dec 2018, 07:30 PM
This is not working for me. The code snippit does not throw an error, but the buttons are still visible.
0
Hristo
Telerik team
answered on 20 Dec 2018, 01:19 PM
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.
0
Christian
Top achievements
Rank 1
answered on 20 Dec 2018, 02:37 PM

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

 

Thanks,

Christian

0
Hristo
Telerik team
answered on 21 Dec 2018, 11:18 AM
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.
Tags
RichTextEditor
Asked by
Mohammed
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Mohammed
Top achievements
Rank 1
Christian
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or