Hide Context Menu

2 posts, 0 answers
  1. Developer
    Developer avatar
    43 posts
    Member since:
    Apr 2014

    Posted 17 Mar 2016 Link to this post

    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.
  2. Dimitar
    Admin
    Dimitar avatar
    356 posts

    Posted 18 Mar 2016 Link to this post

    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.
Back to Top