Cancel ContextMenu

2 posts, 0 answers
  1. György
    György avatar
    7 posts
    Member since:
    Jan 2009

    Posted 04 Feb 2010 Link to this post

    Hi, all!

    I have a Tabstrip with some tab. I have a contextmenu also what I use for the right click on each tab (RadContextMenu's

    ContextMenuControlTarget ControlID

     

    property). But at one tab I do not want to show the ContextMenu.
    My problem is that in the TabStrip's OnClientContextMenu event I can not cancel the contextmenu to open and in the ContextMenu's OnClientShowing event I do not know which tab triggerd the event so I can not cancel the desired event.
    Any suggestion?

    Thanks.

  2. Yana
    Admin
    Yana avatar
    5030 posts

    Posted 05 Feb 2010 Link to this post

    Hi György,

    You can use get_targetElement() method to find which tab is right-clicked like this:

    <script type="text/javascript">
        function menuShownig(sender, args) {
            if (args.get_targetElement().innerText == "some_val")
                args.set_cancel(true);
        }
    </script>

    Regards,
    Yana
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top