This is a migrated thread and some comments may be shown as answers.
RadContextMenu: No SubMenu Click Events on Dynamically Constructed Menu
3 Answers 94 Views
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 27 Nov 2008, 11:37 PM
I'm dynamically constructing a ContextMenu and all the items work perfectly when they are added at the top level, however if the items are added as a submenu their Click event never fires, Have you any ideas what I might be doing wrong the puesdo code changes from

m.Items.Add(new RadMenuItem() { Header = "Item 1" });
m.Items.Add(new RadMenuItem() { Header = "Item 2" });
m.Items.Add(new RadMenuItem() { Header = "Item 3" });

to 
RadMenuItem s = new RadMenuItem() { Header = "SubMenu" };
s.Items.Add(new RadMenuItem() { Header = "Item 1" });
s.Items.Add(new RadMenuItem() { Header = "Item 2" });
s.Items.Add(new RadMenuItem() { Header = "Item 3" });
m.Items.Add(s);

Thanks in advance for any help

John

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 28 Nov 2008, 07:27 AM
Hello John,

I've tested your scenario and all RadMenuItem fires Click event (even when added as submenu).
Can you provide a sample project where Click event is not fired so I can investigate it further.
 

Regards,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
John
Top achievements
Rank 1
answered on 28 Nov 2008, 01:14 PM
Hristo

Sorry our attempts to hide the ContextMenu were causing this problem. We are simulating a RightClickMenu in our SilverLight control (RightClick event is generated from a transparent Div overlaying the SilverLight Control). We open the menu manually using IsOpen, however we need to find away of automatically closing the control if someone clicks outside the menu - as with windows or the ContextMenu if it's loaded using the conventional LeftMouseButton Down event.

Do you have any suggestions on ways we can acheive this, perhaps by leveraging some of the exsiting functionality of the control,

Thanks in advance

John
0
Hristo
Telerik team
answered on 28 Nov 2008, 04:51 PM

Hi John,

This is default behavior of RadContextMenu - to close when user click outside of menu. But there was a bug that is fixed now. In the middle of December we will release Service Pack 2 of RadControls for Silverlight 2.

If you need it now just open a support ticket and I'll send you the hotfix.


Best wishes,

Hristo
the Telerik team

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