New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientNodeCollapsing
The OnClientNodeCollapsing client-side event occurs when the user clicks the collapse (minus) button. The event is called just prior to postback or URL redirection and can be canceled.
The event handler receives parameters:
-
The TreeView instance that fired the event.
-
Event arguments with functions:
-
get_node() retrieves a reference to the clicked on node.
-
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 collapsing.
The example below shows how to prevent collapsing the "Search" node. Note that the OnClientNodeCollapsed event does not fire when the collapse (minus) button is clicked.
ASPNET
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1"
runat="server"
OnClientNodeCollapsed="ClientNodeCollapsed"
OnClientNodeCollapsing="ClientNodeCollapsing">
</telerik:RadTreeView>