|
Article relates to
|
RadFileExplorer
|
|
Created by
|
Fiko, Telerik
|
|
Last modified
|
May 20, 2009
|
|
Last modified by
|
Fiko, Telerik
|
HOW-TO
Remove command(s) from the toolbar and context menus in the
RadFiileExplorer control. The example is about removing the
"Delete" and
"Upload" commands, but the same approach can be applied for any of the remaining commands.
First we need to get reference to all of the objects that contain the
"Delete" and
"Upload" commands, and then remove the commands. The embedded into
RadFileExplorer controls that need to be affected are :
RadToolBar,
RadTreeView's context menu,
RadGrid's context menu. This can be done as follows :
- RadToolBar - RadFileExplorer1.ToolBar
- RadtreeView's context menu - RadFileExplorer1.TreeView.ContextMenu[0]. The RadToolBarItemCollection contains only one context menu and we get reference to that one.
- RadGrid's context menu - RadFileExplorer1.GridContextMenu
Then we can use the following approach in order to remove the commands :
C# :
VB.NET :
The same approach can be applied to the RadTreeView's context menu and RadGrid's context menu.
Please do not forget to use the continue statement in case that an item is deleted. The statement is used in order to avoid an error like : "Index was out of range...".
Please
Sign In
to rate this article.