OnClientNodeDropping
The OnClientNodeDropping client-side event is called before nodes are dropped and can be canceled.
The event handler receives parameters:
-
The TreeView instance that fired the event.
-
Event arguments with functions:
-
get_destNode() retrieves a reference to the destination node, i.e. the node that is being dropped onto.
-
get_dropPosition() returns the relative position of the dropped node(s) and can be "over", "above" or "below".
-
get_htmlElement() retrieves the DOM html element representing the destination node.
-
get_sourceNode() retrieves the node being dropped.
-
get_sourceNodes() retrieves an array of nodes being dropped. It is useful when the RadTreeView MultipleSelect property is True.
-
set_cancel() - call this function to specify whether the event should be canceled (true) or not (false).
-
get_domEvent() retrieves a DOM event object of the node dropping.
The example below demonstrates preventing a node from being dropped between levels and also displays information from each of the eventArgs functions.
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1"
runat="server"
EnableDragAndDrop="True"
MultipleSelect="True"
OnClientNodeDropping="ClientNodeDropping">
</telerik:RadTreeView>