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

Disable dragging of root nodes in RadTreeview

1 Answer 223 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
sahar
Top achievements
Rank 1
sahar asked on 24 Feb 2009, 08:23 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2009, 05:48 AM
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.
Tags
TreeView
Asked by
sahar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or