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

Disable ContextMenu

3 Answers 222 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Andrea Rossi
Top achievements
Rank 1
Andrea Rossi asked on 19 Mar 2009, 12:02 PM

Hi,
i want to disable  grid and treeview context  menus.

For grid
FileExplorer1.GridContextMenu.Enabled =False

 

seems not to work.

How to for treeview?

Thank you.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Tom Gioconda
Top achievements
Rank 1
answered on 19 Mar 2009, 06:58 PM

Assuming your file explorer instance is called "rad_content_file_explorer", turn off the context menu like this:

rad_content_file_explorer.TreeView.ContextMenus.RemoveAt(0); 

I've not tried it for the grid context menu, although you could try
rad_content_file_explorer.GridContextMenu.Items.Clear(); 

You can also customize them - I use the items collection of GridContextMenu to remove NewFolder, Upload, and Rename, but leave everything else.  You have to do a little debugging of the object to see what's there, the documentation on this control doesn't really exist in a useful form as of yet.
0
Andrea Rossi
Top achievements
Rank 1
answered on 23 Mar 2009, 08:26 AM
Hi Tom,
I tried your suggestion for turn off the context menu and customize them, now  all it works.

Thank you.

Greetings,
Andrea
0
Tervel
Telerik team
answered on 23 Mar 2009, 12:05 PM
Hi all,

Tom, thank you for providing this suggestion! I just wanted to follow up and mention that we plan to add the context menu to the FileExplorerControls enum of RadFileExplorer.
This will make it possible to siwtch-off the context menu(s) completely by simply de-listing them from the FileExplorer VisibleControls property, e.g.

<telerik:RadFileExplorer VisibleControls = "Grid,TreeView" ../>

Best regards,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
FileExplorer
Asked by
Andrea Rossi
Top achievements
Rank 1
Answers by
Tom Gioconda
Top achievements
Rank 1
Andrea Rossi
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or