This is a migrated thread and some comments may be shown as answers.

How to determine right click on node

2 Answers 83 Views
Menu
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 15 Oct 2008, 02:22 PM
Hi, I am using the RadTree control and the RadMenu control to launch a right click menu from the tree. I would like to display an alert when the right click is not made on the tree, please advise if it's possible to capture the right click event for the RadMenu or any property where I can determine whether the right click was performed on the RadTree for the RadMenu or whether it was a random right click.
Thanks alot!

MJ

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Oct 2008, 09:37 AM
Hi,

Try the following javascript code to show an alert on right clicking the RadTreeview.

JS:
 <script type="text/javascript" language="javascript" > 
   function OnClientClick(sender,eventArgs) 
    { 
      alert("You have Clicked:" + sender.get_id() ); 
    }  
  
</script> 


ASPX:
<telerik:RadTreeView ID="RadTreeView1" OnClientContextMenuShowing="OnClientClick"  runat="server"
    <Nodes > 
       ...... 


Thanks
Shinu
0
M
Top achievements
Rank 1
answered on 16 Oct 2008, 02:00 PM
Hi Shinu,
Thanks a lot!
However, I already have code that launches the right click alert - its in javascript on the document.oncontextmenu.
What I'd like to accomplish is to disable the right click alert when I click on a radmenu item on the radtree.
Please advise.
Thanks!
MJ
Tags
Menu
Asked by
M
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
M
Top achievements
Rank 1
Share this question
or