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

[Solved] how to add event handler to radmenuitems when added to richtextbox

1 Answer 65 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
satish
Top achievements
Rank 1
satish asked on 06 Sep 2010, 08:20 PM

hi
i added  radmenuitems to richtextbox

 

 

 

<telerik:RadRichTextBox Loaded="UserControl_Loaded" Grid.Row="1" x:Name="editor"

 

 

 

Margin="24 24 0 0" AllowDrop="True"

 

 

 

>

 

 

 

 

<telerik:RadContextMenu.ContextMenu>

 

 

 

 

<telerik:RadContextMenu>

 

 

 

 

<telerik:RadMenuItem Header="Insert Coupon" />

 

 

 

 

<telerik:RadMenuItem Header="Insert Vehicle" />

 

 

 

 

</telerik:RadContextMenu>

 

 

 

 

</telerik:RadContextMenu.ContextMenu>

 

 

 

 

</telerik:RadRichTextBox>

 

when i tried to add event handler , it is giving error :

 

this

 

 

.editor.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnContextMenuClick), true);

 


error is attached , please help

thanks in advance

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 09 Sep 2010, 05:10 PM
Hi Satish,
Try using RadRoutedEventHandler, like this:
private void buttonDo_Click(object sender, RoutedEventArgs e)
{
    this.editor.AddHandler(RadMenuItem.ClickEvent, new RadRoutedEventHandler(RadMenuItem_Click));
}
 
private void RadMenuItem_Click(object sender, RadRoutedEventArgs e)
{
 
}

Don't hesitate to contact us if you have other questions.


Kind regards,
Boby
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
Tags
RichTextBox
Asked by
satish
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or