I like the context menu that comes default with the radrichtext box, however, I would like to drop a few of the options. Can I do that just by editing the Context menu, or do I need to write my own context menu? If I need to write my own, how can I include the spell check functionality in my context menu?
Thanks,
Michael
Thanks,
Michael
4 Answers, 1 is accepted
0
Joseph
Top achievements
Rank 1
answered on 19 Nov 2010, 12:28 PM
I have the same inquery.
I need to add extra custom elements to the contextMenu. Like a new menuitem with sub elements.
if there a way to access this menu programatically ? thanks.
I need to add extra custom elements to the contextMenu. Like a new menuitem with sub elements.
if there a way to access this menu programatically ? thanks.
0
Hello Joseph and Michael,
You can examine our blog post about customizing the RadRichTextBox's ContextMenu.
Please get back to us if you have other questions.
Regards,
Boby
the Telerik team
You can examine our blog post about customizing the RadRichTextBox's ContextMenu.
Please get back to us if you have other questions.
Regards,
Boby
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Keith
Top achievements
Rank 1
answered on 13 Jun 2011, 09:33 PM
This constantly referenced post does not show how to hide any of the items like Hyperlink..., Paragraph, etc. that appear in the ContextMenu. Here is how I achieved this.
private void ContextMenu_Showing(object sender, ContextMenuEventArgs e)
{
// Get
var groups = e.ContextMenuGroupCollection;
// Remove Spelling... menu item if it is present
if (groups[0].Last().Command is Telerik.Windows.Documents.RichTextBoxCommands.ShowSpellCheckingDialogCommand)
{
// Hide Spelling...
groups[0].Last().Visibility = Visibility.Collapsed;
}
// Clear everything from the menu except for the Spelling and Cut/Copy/Paste
for (int i = 1; i < e.ContextMenuGroupCollection.Count; i++)
{
groups[i].Clear();
}
}
private void ContextMenu_Showing(object sender, ContextMenuEventArgs e)
{
// Get
var groups = e.ContextMenuGroupCollection;
// Remove Spelling... menu item if it is present
if (groups[0].Last().Command is Telerik.Windows.Documents.RichTextBoxCommands.ShowSpellCheckingDialogCommand)
{
// Hide Spelling...
groups[0].Last().Visibility = Visibility.Collapsed;
}
// Clear everything from the menu except for the Spelling and Cut/Copy/Paste
for (int i = 1; i < e.ContextMenuGroupCollection.Count; i++)
{
groups[i].Clear();
}
}
0
Hello Keith,
Iva
the Telerik team
Thank you for sharing the approach you have adopted for customizing the context menu.
I personally find the approach with custom content menu builder neater, but both solutions produce the same effect in the end.
You can find some demos with custom context menus in this forum thread.
Iva
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items