Disable some context menus and menu items

2 posts, 1 answers
  1. Mihajlo
    Mihajlo avatar
    47 posts
    Member since:
    Aug 2018

    Posted 04 Oct 2018 Link to this post

    How do I disable context menus "EditHeader" and "EditFooter", so that they don't show up?

    How do I remove (rather than disable) context menu item "Hyperlink..."?

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4125 posts

    Posted 05 Oct 2018 Link to this post

    Hello, Mihajlo, 

    The following code snippet demonstrates how you can control which items to be visible in the context menu that RadRichTextEditor shows and hide the redundant ones:

    public RadForm1()
        Telerik.WinControls.RichTextEditor.UI.ContextMenu menu =
            this.radRichTextEditor1.RichTextBoxElement.ContextMenu as Telerik.WinControls.RichTextEditor.UI.ContextMenu;
        menu.ContentBuilder = new CustomContextMenuContentBuilder();
    public class CustomContextMenuContentBuilder : Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus.ContextMenuContentBuilder
        public override Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus.ContextMenuGroupCollection Construct()
            Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus.ContextMenuGroupCollection collection = base.Construct();
            foreach (var item in collection)
                Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus.ContextMenuGroup group = item as Telerik.WinForms.RichTextEditor.RichTextBoxUI.Menus.ContextMenuGroup;
                if (group!=null)
                    foreach (var menuItem in group)
                        if (menuItem.Text.Contains("Hyperlink") )
                            menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            return collection;
        private void menuItem_Click(object sender, EventArgs e)

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    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