This is a migrated thread and some comments may be shown as answers.
Cancel ContextMenu
1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
György
Top achievements
Rank 1
György asked on 04 Feb 2010, 03:21 PM
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.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Feb 2010, 08:10 AM
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.
Asked by
György
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or