New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnClientNodeDropping

The OnClientNodeDropping client-side event is called before nodes are dropped and can be canceled.

The event handler receives parameters:

  1. The TreeView instance that fired the event.

  2. 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.

ASPNET
	    <telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" 
	                         runat="server" 
	                         EnableDragAndDrop="True" 
	                         MultipleSelect="True"
	                         OnClientNodeDropping="ClientNodeDropping">
	    </telerik:RadTreeView>
Not finding the help you need?
Contact Support