Version

SelectionChanging Property (DataTreeClientEvents)

This event is fired, before a change in the selection occur.
Syntax
'Declaration
 
Public Property SelectionChanging As String
public string SelectionChanging {get; set;}
Example
WebDataTree1.ClientEvents.SelectionChanging = "WebDataTree_SelectionChanging"
WebDataTree1.ClientEvents.SelectionChanging = "WebDataTree_SelectionChanging";
// The client event 'SelectionChanging' takes two parameters sender and e
// sender  is the object which is raising the event
// e is the DataTreeSelectionEventArgs
function WebDataTree_SelectionChanging(sender, e) {

    //Get the newly selected tree nodes array
    var newSelectedNodes = e.getNewSelectedNodes();

    //Gets the text of the node at index 0 in the array
    var nodeText = newSelectedNodes[0].get_text();

    if (!confirm("Are you sure you want to select the node '" + nodeText + "'?"))
        //Cancels the SelectionChanging event
        e.set_cancel(true);
        
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also