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

Problem with closing RadMenu

1 Answer 96 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Wolfgang
Top achievements
Rank 1
Wolfgang asked on 27 May 2013, 04:17 PM
Hi!

I'm using Telerik WinForms Q1 2013 SP1.

I've inserted a RadMenu with a RadMenueButtonItem in my Main WindowsForm.
When the RadMenueButtonItem is clicked a Form is shown with newForm.ShowDialog();
The problem i have: the radMenue is still open until i click on the Form.
How can i close the RadMenue when a RadMenueButtonItem is clicked?
I've tried to set the Focus on the new Form, but didn't help.
Only a click event on the new shown Form closes the RadMenu.

Thanks a lot for any help...

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 May 2013, 12:24 PM
Hello Wolfgang,

Thank you for writing.

If I understand correctly, you have a RadMenuButtonItem in a RadMenuItem and when you click the former, you open a dialog and the popup remains opened. If so, you can just access the popup of the menu item (the parent of the RadMenuButtonItem) and close its popup. Here is a sample:
void btn_Click(object sender, EventArgs e)
{
    RadMenuButtonItem item = (RadMenuButtonItem)sender;
    RadMenuItem parent = item.ParentItem as RadMenuItem;
    Console.WriteLine(parent.IsPopupShown);
    parent.DropDown.ClosePopup(RadPopupCloseReason.CloseCalled);
    Form1 fz = new Form1();
    fz.ShowDialog();
}

Let me know how this works for you.
 

Regards,
Stefan
Telerik
RadChart for WinForms is obsolete. Now what?
Tags
Menu
Asked by
Wolfgang
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or