The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientTreeView.NodeClick Event

Fires on the client side after a node has been clicked.

Declaration

NodeClick: ASPxClientEvent<ASPxClientTreeViewNodeClickEventHandler<ASPxClientTreeView>>

Event Data

The NodeClick event handler receives an argument of the ASPxClientTreeViewNodeClickEventArgs type. The following properties provide information specific to this event.

Property Description
htmlElement Gets the HTML object that contains the processed node.
htmlEvent Gets a DHTML event object that relates to the processed event.
node Gets a node object related to the event.
processOnServer Gets or sets a value that specifies whether the event should be finally processed on the server side.

Remarks

Write an NodeClick event handler to perform specific actions on the client side each time a node is clicked. Note that this event fires immediately after the left mouse button is released. If the button is released when the mouse pointer is not over a node, the event doesn't fire. You can use the event parameter's properties to identify the clicked node and specify whether a postback should be generated, to pass the event processing to the server side.

Examples

The code below shows how you can handle the client NodeClick event to expand and collapse nodes with a click.

   <dx:aspxtreeview id="ASPxTreeView1" runat="server" datasourceid="XmlDataSource1">
    <ClientSideEvents NodeClick="function(s, e) {
    e.node.SetExpanded(!e.node.GetExpanded());
    }"></ClientSideEvents>
   </dx:aspxtreeview>
See Also