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

Hide functions to format the text

2 Answers 12 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Harald
Top achievements
Rank 1
Harald asked on 18 Jul 2019, 06:45 AM
How can I display only the spellchecker and the clipboard functions for a RichTextBox in the ConextMenu? All functions to format the text should be hidden.

2 Answers, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 22 Jul 2019, 08:17 AM
Hello Harald,

You can customize the context menu of RadRichTextBox by implementing a custom ContextMenuContentBuilder. Here is a sample implementation which leaves only the menu groups related to the clipboard and spell checking:
public class CustomContextMenuContentBuilder : ContextMenuContentBuilder
{
    public override ContextMenuGroupCollection Construct()
    {
        var menuGroupsCollection = base.Construct();
 
        foreach (var menuGroup in menuGroupsCollection.ToList())
        {
            if (menuGroup.Type != ContextMenuGroupType.ClipboardCommands && menuGroup.Type != ContextMenuGroupType.SpellCheckingCommands)
            {
                menuGroupsCollection.Remove(menuGroup);
            }
        }
 
        return menuGroupsCollection;
    }
}

For more information on how you can use this class and plug it into RadRichTextBox, please check the Context Menu help topic.

Hope this information is helpful.

Regards,
Tanya
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
Harald
Top achievements
Rank 1
answered on 22 Jul 2019, 05:28 PM
Thanks!
Tags
RichTextBox
Asked by
Harald
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Harald
Top achievements
Rank 1
Share this question
or