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

Right click shall select a node

1 Answer 139 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Covertix
Top achievements
Rank 1
Covertix asked on 01 Sep 2008, 04:14 PM
Hello Telerik support,

I would like to make a node selected if I right click on top of it.
Current behaviour requires me to first left click a node (select it) and only then right click works correctly.

Regards,
Tzach.

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 03 Sep 2008, 10:46 AM
Hello Tzach Kaufmann,

You can do that by handling the NodeMouseDown event of RadTreeView:
 
    void radTreeView1_NodeMouseDown(object sender, RadTreeViewMouseEventArgs e) 
        { 
            if (e.OriginalEventArgs.Button == MouseButtons.Right) 
            { 
                this.radTreeView1.SelectedNode = e.Node; 
            } 
        } 

However, if you want this because of the context menu, you can also take a look at the ContextMenuShowing event of RadTreeView.
 

Best wishes,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Treeview
Asked by
Covertix
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or