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

RadMenu event for silverlight

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michal Revivo
Top achievements
Rank 1
Michal Revivo asked on 01 Jul 2008, 07:14 PM
Hi
I successfully populate a radMenu silverlight control.
How I can catch event when the user is clicking on one of the menu ?
and how I retrieve info on the menu item selected ?
Thanks in advance
Regards
Fred

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 02 Jul 2008, 07:35 AM
Hi Fred,

RadMenuItem class exposes Click, Checked, Unchecked, SubmenuOpened and SubmenuClosed events. You can attach event handlers to the events you need.

public partial class Page : UserControl  
{  
   public Page()  
   {  
      InitializeComponent();  
      RadMenu menu = new RadMenu();  
      RadMenuItem item = new RadMenuItem();  
      item.Click += new RoutedEventHandler(MenuItemClick);  
      menu.Items.Add(item);  
      RootElement.Children.Add(menu); // RootElement is a Grid defined in Page XAML   
   }  
 
   void MenuItemClick(object sender, RoutedEventArgs e)  
   {  
      RadMenuItem item = sender as RadMenuItem;  
      //Use the MenuItem  
   }  



To see if some item is checked, you can use IsChecked property.

If you have any other questions, do not hesitate to ask.



Best wishes,
Hristo
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Michal Revivo
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or