ASPxClientTreeViewNode.GetExpanded Method

Returns a value indicating whether the node is expanded.

Declaration

GetExpanded(): boolean

Returns

Type Description
boolean

true if the node is expanded; otherwise, false.

Remarks

The ASPxTreeView allows end-users to expand/collapse nodes. To determine the node's expansion state, use the GetExpanded method on the client side. In order to expand/collapse a node on the client side, use the ASPxClientTreeViewNode.SetExpanded method.

To learn more, see the Expanding and Collapsing Nodes topic.

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