Disable dragging of root nodes in RadTreeview

2 posts, 0 answers
  1. sahar
    sahar avatar
    6 posts
    Member since:
    Jan 2009

    Posted 24 Feb 2009 Link to this post

    hi

    i need to map data from a tree view to a datagrid textbox control , i have seen a example of tree view with drag in drop-

    In my scenario i dont want to stop the dragging of root node of each node is it possible ?? i have seen a post i n which some wrtie to use enable disable propety of a node by getting the vlaue or text of a node bu in my case the root nodes or the whole tree wud be different the root nodes wil not be known coz the data in tree view will be generated thraough an excel file data and the columns for root nade and values will be differnet

    is it possible to identify the root nodes dynamically and can we stop dragging of root nodes only

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Feb 2009 Link to this post

    Hi Sahar,

    Try adding the following JavaScript in order to disable the drag and drop features of root node. The client side pageLoad() function will fire when the page is loaded and rendered all the controls in the page.

    JavaScript:
    <script type="text/javascript"
    function pageLoad() 
        var tree = $find("<%= RadTreeView1.ClientID %>"); 
        var node0 = tree.get_nodes().getNode(0); // get the root node 
        node0.set_allowDrag(false); 
        node0.set_allowDrop(false); 
    </script> 

    Thanks,
    Shinu.
Back to Top