RadMenu and RadMenuComboItem

3 posts, 1 answers
  1. Scott
    Scott avatar
    16 posts
    Member since:
    Sep 2012

    Posted 16 Oct 2012 Link to this post

    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. Answer
    Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 17 Oct 2012 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Scott
    Scott avatar
    16 posts
    Member since:
    Sep 2012

    Posted 17 Oct 2012 Link to this post

    Thank you that is exactly what I needed.
Back to Top