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

Menu Grouping

1 Answer 50 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jon Bergquist
Top achievements
Rank 1
Jon Bergquist asked on 20 Mar 2009, 08:09 PM
Is it possible to use the menu similar to an option grouping?  What I'm looking for is the ability to select a menu item and have the other ones disable.  I would also like to have a top level click event handling so I don't have separate click events for each item.  These menu items would all be top level.

Thanks

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 24 Mar 2009, 03:20 PM
Hello Jon Bergquist,

First sorry for the late response.
Can you collaborate more on what you want to achieve. Do you want something like RadioButtons in the menu? Or you need just to disable the other menuItems?

You can define a click event using this code:
radMenu.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnMenuItemClick));  
 
private void OnMenuItemClick(object sender, RoutedEventArgs e)  
{  
    RadRoutedEventArgs args = e as RadRoutedEventArgs;  
    RadMenuItem clickedMenuItem = args.OriginalSource as RadMenuItem;  
    foreach (object item in radMenu.Items)  
    {  
        RadMenuItem menuItem = radMenu.ItemContainerGenerator.ContainerFromItem(item) as RadMenuItem;  
        if (menuItem != null)  
        {  
            //menuItem.IsEnabled = menuItem == clickedMenuItem;     
        }  
    }   

Waiting for your response.
 

Kind regards,
Kaloyan Manev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Jon Bergquist
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or