disable right click in file explorer telerik
Greetings everyone, i just wanna ask.. how do i disable the right click property in a telerik file explorer... what i want to achieve particularly is to restrict the user from deleting a file or folder.. i managed to hide the delete in toolbar but not in the right click.. kindly he开发者_如何学编程lp me out... thanks...
Below is the code i did for hiding the toolbar items.. but disabling the items in the right click.. that's my problem..
Private Sub HideToolBarButtons()
' Hides toolbar buttons
Me.FileExplorer1.ToolBar.Items.FindItemByValue("NewFolder").Visible = False
Me.FileExplorer1.ToolBar.Items.FindItemByValue("Delete").Visible = False
Me.FileExplorer1.ToolBar.Items.FindItemByValue("Upload").Visible = False
End Sub
Protected Overrides Sub OnLoadComplete(ByVal e As EventArgs)
MyBase.OnLoadComplete(e)
HideToolBarButtons()
End Sub
If you set the DeletePaths property in the file explorer's configuration to an empty array, the delete buttons will be removed automatically (the same is valid for the UploadPaths and upload button).
If you just want to remove the items from the context menus, then you can access those through the fileExplorer.GridContextMenu and fileExplorer.Tree.ContextMenus[0] respectively for the grid and tree components.
You might be able to iterate over the menu items in the context menu on the file explorer (assuming you have access to it). Then when you find the menu item for delete, you could try setting a combination of enabled/visible to false.
精彩评论