RadMenuItem Click event not working using Event Triggers

2 posts, 0 answers
  1. Vidyadhar
    Vidyadhar avatar
    23 posts
    Member since:
    Oct 2011

    Posted 20 Mar 2012 Link to this post


    Am trying to fire the Click Event on the RadMenuItem using Expression Blend's Event Triggers, but couldn't get it triggered. The trigger fires for the buttons, Checkboxes, etc... but not for the RadMenuItem_Click. I recently upgraded my application to Silverlight 5 and the latest Telerik Controls (Silverlight 5 Q1 2012).

                        <telerik:RadContextMenu NotifyOnHeaderClick="True">
                            <telerik:RadMenuItem Name="TreeNode_MenuItem_1" Header="Map Zoom" >
                                    <i:EventTrigger EventName="Click">
                                        <ei:CallMethodAction TargetObject="{Binding}" MethodName="onContextMenuClick" />     
                            <telerik:RadMenuItem Name="TreeNode_MenuItem_2" Header="View Detail Data"/>

    And here's my ViewModel method.

        public void onContextMenuClick(object sender, RoutedEventArgs e)
                //get the telerik context menu item
                RadMenuItem menuItem = e.OriginalSource as RadMenuItem;           

    I did try using RadRoutedEventArgs instead of RoutedEventArgs, and also the EventArgs, but none helped.

    Can you help me out with this.
  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 26 Mar 2012 Link to this post

    Hi Vidyadhar,

    I tested your code and it seems to work as expected - the method is called once the menu item is clicked. Please make sure that you have set properly the DataContext and that it has reached correctly to the RadContextMenu.
    For your reference I am sending you a short video which illustrates my attempt.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top