Menu Grouping

2 posts, 0 answers
  1. Jon Bergquist
    Jon Bergquist avatar
    47 posts
    Member since:
    Sep 2008

    Posted 20 Mar 2009 Link to this post

    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.

  2. Kaloyan
    Kaloyan avatar
    920 posts

    Posted 24 Mar 2009 Link to this post

    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.
Back to Top