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

ContextMenu

2 Answers 217 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Filipe Rodrigues
Top achievements
Rank 1
Filipe Rodrigues asked on 17 May 2007, 09:07 AM
Hi,
I have a radtreeview and I need to have a contextmenu in the nodes...I'm using a RadDropDownMenu and in the radtreeview.radcontext menu I choosed the RadDropDownMenu name. But the treeview doesn't show any context menu. What i'm doing wrong?
Thanks.

2 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 1
answered on 17 May 2007, 07:29 PM
There is an alternative way to achieve your task.
1) Assign a context menu to your treeView
this.radTreeView1.RadContextMenu = this.radDropDownMenu1; 
2) Handle TreeView's MouseDown event
 void radTreeView1_MouseDown(object sender, MouseEventArgs e) 
 { 
     if (e.Button == MouseButtons.Right) 
     { 
         this.radDropDownMenu1.Show(); 
         this.radDropDownMenu1.Location = Cursor.Position; 
     } 


0
Jordan
Telerik team
answered on 18 May 2007, 02:43 PM
Hello Filipe,

If you want to have a context menu for a particular node, just set the node's ContextMenu property to a RadDropDownMenu instance like:
 
radTreeNode1.ContextMenu = this.radDropDownMenu1; 

If you have any other questions we'll be happy to help.

Regards,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
Filipe Rodrigues
Top achievements
Rank 1
Answers by
Jason
Top achievements
Rank 1
Jordan
Telerik team
Share this question
or