RadContextMenu: No SubMenu Click Events on Dynamically Constructed Menu

4 posts, 0 answers
  1. John
    John avatar
    6 posts
    Member since:
    Nov 2008

    Posted 27 Nov 2008 Link to this post

    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

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 28 Nov 2008 Link to this post

    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.
  3. DevCraft banner
  4. John
    John avatar
    6 posts
    Member since:
    Nov 2008

    Posted 28 Nov 2008 Link to this post

    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
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 28 Nov 2008 Link to this post

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