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

Prevent Auto-Expand of Nodes during Drag and Drop?

1 Answer 130 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 27 Oct 2009, 06:02 PM
Hi,

The Drag-and-Drop example between a RadTreeView and a RadGrid works fine, but we need to lock-down the TreeView while the user drags to the RadGrid. You see, if the TreeView is large, and the user drags one of the top nodes slowly across the TreeView, then it is quite annoying for the TreeView to expand all the nodes while dragging... I've disabled "Dropping" on the TreeView, but that has no effect on the Expand mode, of course. Any tips on how to elegantly disable ExpandMode while dragging a node?

Thanks!
R

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Oct 2009, 07:03 AM
Hi Richard,

Attach the OnClientNodeExpanding event to RadTreeView and cancel the event if you are dragging a node.

javascript:
 
<script type="text/javascript"
    function OnClientNodeExpanding(sender, args) { 
        if (sender._dragging) { 
            args.set_cancel(true); 
        } 
    } 
</script> 

-Shinu.
Tags
TreeView
Asked by
Richard
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or