This question is locked. New answers and comments are not allowed.
Cuthahotha
Top achievements
Rank 1
Cuthahotha
asked on 30 Nov 2010, 03:26 PM
Is it possible to add an item to a rich text box context menu? I would like to test to see that a word is selected, then add to the context menu a "Add Keyword" menu item.
Thanks,
Steve
Thanks,
Steve
4 Answers, 1 is accepted
0
Accepted
Hi Cuthahotha,
Take a look at our blog post about customizing RadRichTextBox's context menu and selection mini toolbar.
All the best,
Boby
the Telerik team
Take a look at our blog post about customizing RadRichTextBox's context menu and selection mini toolbar.
All the best,
Boby
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Steve Moss
Top achievements
Rank 1
answered on 30 Nov 2010, 04:52 PM
EXCELLENT!
Thanks,
Steve
Thanks,
Steve
0
Edward
Top achievements
Rank 1
answered on 23 Apr 2012, 09:10 PM
I was using that Showing event handler, and noticed that a richtextbox declared in one page can access the same context menu as another richtextbox in another page?
0
Hello Edward,
The behavior you are observing is caused by the fact that MEF caches ContextMenu instances and reuse them for satisfying the imports of all RadRichTextBoxes - actually all RadRichTextBox instances uses the same context menu. You have two options:
Kind regards,
Boby
the Telerik team
The behavior you are observing is caused by the fact that MEF caches ContextMenu instances and reuse them for satisfying the imports of all RadRichTextBoxes - actually all RadRichTextBox instances uses the same context menu. You have two options:
- manually set different instances of ContextMenu to all your RadRichTextBox-es
this
.radRichTextBox.ContextMenu =
new
Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();
- Create custom context menu that will be non-sharable. MEF will automatically load different instances of it for all RadRichTextBoxes on demand:
[PartCreationPolicy(CreationPolicy.NonShared)]
[CustomContextMenu]
public
class
NonSharedContextMenu : ContextMenu
{
}
Don't hesitate to contact us if you have other questions.
Kind regards,
Boby
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>