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

Hide Context Menu

1 Answer 91 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Developer
Top achievements
Rank 1
Developer asked on 17 Mar 2016, 01:59 PM
Hi,
I have a radtreeview that has a context menu.  I would like to hide the entire context menu based upon the value of the node attribute.
I can kind of achieve this by hiding individual menu items, however a small animation is still shown even if no menu items are displayed.
I would like to do this client side if possible.
Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 Mar 2016, 09:59 AM
Hi,

You may enable/disable the context menu for a RadTreeView node client-side using the set_enableContextMenu() setter with true/false parameter. You may test it on the RadTreeView Context Menu demo. The following snippet would enable/disable the context menu for the 'Personal Folders' node:

// Disable the menu
$find('ctl00_ContentPlaceholder1_RadTreeView1').get_nodes().getNode(0).set_enableContextMenu(false)
 
// Enable the menu
$find('ctl00_ContentPlaceholder1_RadTreeView1').get_nodes().getNode(0).set_enableContextMenu(true)

And on the server-side, you may use the respective EnableContextMenu property to enable/disable the menu for a given node.

Regards,
Dimitar
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Developer
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or