context menu doesn't stay open

6 posts, 1 answers
  1. Roy
    Roy avatar
    36 posts
    Member since:
    Jun 2008

    Posted 20 Nov 2008 Link to this post

    Hello,

    I'm using the rad context menu as a popup menu, fired up with left mouse click.
    problem is that when the menu slides down and opens, it immediatly closes. i noticed that if i keep the mouse button down, the context menu stays open, but i can't really do nothing that way.
    unfortunatlly i can't add an example here.
    basically, i have a table. each row has an onmousedown event, which fires up the context menu with the help of the contextmenu.show(event) method.

    How can i fix this?
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Nov 2008 Link to this post

    Hi Roy,

    You can try canceling the DOM event bubbling:

    event.cancelBubble = true;
    if (event.stopPropagation)
     event.stopPropagation();

    Best wishes,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roy
    Roy avatar
    36 posts
    Member since:
    Jun 2008

    Posted 20 Nov 2008 Link to this post

    thanks for the help, but i actually fixed it myself.
    i changed the event i used to onclick, and thus the the menu stayed opened.
    probeblly something with the event lifecycle or whatever ;p
  5. Augusto
    Augusto avatar
    19 posts
    Member since:
    Jan 2008

    Posted 20 Feb 2009 Link to this post

    Hello Roy.

    I'm having the same problem as you had. I applied the Telerik code but it does not work.

    What did you change in the event management to make your menu stay open ?

    Thanks for your help
    Best regards

    Augusto
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 23 Feb 2009 Link to this post

    Hello Augusto,

    Can you please paste here some code so we can try to find the problem?

    Thanks

    Regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Augusto
    Augusto avatar
    19 posts
    Member since:
    Jan 2008

    Posted 23 Feb 2009 Link to this post

    Hello.

    I have found out why the context menu did not keep open. It was because the page is nested in a master page and you must put the full control name in the ContextMenuElementId property. The context control is "FpSpreadDashboard" but in a master page the "_ctl0_ContentPlaceHolder_" prefix  is insert before the control id ("ContentPlaceHolder" is the ContentPlaceHolderID property of my nested page) : <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    So it must be: 

    <

    rad:RadMenu ID="RadContextMenu" 
        ... 
        ContextMenuElementID="_ctl0_ContentPlaceHolder_FpSpreadDashboard"
        ...
    </rad:RadMenu>
    Let me know if there is another way of dealing with RadMenu within a master page.
    Thanks

    Best regards
    Augusto

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017