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

RadMenu and RadMenuComboItem

2 Answers 133 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 16 Oct 2012, 07:00 PM
I have a radmenu with a sub radmenucomboitem, I want to close themain menu item on the click event of the radmenucomboitem.  I have the selected changed event wired to change the theme of the app based on what the user selects however the menu stays on the screen until you click the mouse on the main form.  Is there a way to programatically close this?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 17 Oct 2012, 01:02 PM
Hi Scott,

In order to hide the menu popup, you can call HideChildItems method of the menu item from which you are opening the popup. Here is a sample code snippet which demonstrates the approach:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        this.radMenuComboItem1.ComboBoxElement.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(ComboBoxElement_SelectedIndexChanged);
    }
 
    void ComboBoxElement_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
    {
        ThemeResolutionService.ApplicationThemeName = this.radMenuComboItem1.ComboBoxElement.SelectedItem.Text;
        this.radMenuItem1.HideChildItems();
    }
}

I hope this helps.All the best,
Nikolay
the Telerik team
You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
0
Scott
Top achievements
Rank 1
answered on 17 Oct 2012, 03:04 PM
Thank you that is exactly what I needed.
Tags
Menu
Asked by
Scott
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Scott
Top achievements
Rank 1
Share this question
or