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

[Solved] How to disable the context menu in rad tree view

1 Answer 138 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Albert Ho
Top achievements
Rank 2
Albert Ho asked on 10 Jun 2008, 09:50 PM
Hi,

How can I hide the context menu if I right click the blank place in the tree view?

Thanks

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 13 Jun 2008, 01:21 PM
Hi Albert Ho,

Please try the following approach (put the script below in the page where the TreeView is located; RadTreeView1 is the ID of the TreeView on the page):

        function pageLoad() 
        { 
            var treeDiv = $get("<%= RadTreeView1.ClientID %>"); 
             
            $addHandler(treeDiv, "contextmenu", onMouseDown); 
        } 
         
        function onMouseDown(e) 
        { 
            e.preventDefault(); 
        } 

I hope this is what you were looking for.

All the best,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Albert Ho
Top achievements
Rank 2
Answers by
Simon
Telerik team
Share this question
or