Back to Devexpress

Expanding and Collapsing Nodes

aspnetmvc-10355-components-site-navigation-and-layout-tree-view-expanding-and-collapsing-nodes.md

latest3.4 KB
Original Source

Expanding and Collapsing Nodes

  • Feb 02, 2023

TreeView allows end-users to hide/show a node children. End-users can expand or collapse nodes by double-clicking them. It is also possible to expand/collapse nodes by clicking expand buttons. The visibility of these buttons can be controlled by using the TreeViewSettings.ShowExpandButtons property.

TreeView provides the server and client API, which expand and collapse nodes in code. You can perform the following actions with a node.

To impact a particular node:Client MembersServer Members
To expand/collapse a particular nodeASPxClientTreeViewNode.SetExpandedTreeViewNode.Expanded (via MVCxTreeViewNode .Expanded )
To determine the node’s expansion stateASPxClientTreeViewNode.GetExpandedTreeViewNode.Expanded (via MVCxTreeViewNode .Expanded )
To expand TreeView down to the specified nodeASPxTreeView.ExpandToNode (via MVCxTreeView .ExpandToNode )
To impact all nodes:Client MembersServer Members
To expand all nodesASPxClientTreeView.ExpandAll (via MVCxClientTreeView .ExpandAll )ASPxTreeView.ExpandAll (via MVCxTreeView .ExpandAll )
To collapse all nodesASPxClientTreeView.CollapseAll (via MVCxClientTreeView .CollapseAll )ASPxTreeView.CollapseAll (via MVCxTreeView .CollapseAll )
To expand all nodes to the defined depthASPxTreeView.ExpandToDepth (via MVCxTreeView .ExpandToDepth )
To respond to expanding/collapsing nodes:Client EventsServer Events
Before actionASPxClientTreeView.ExpandedChanging (via MVCxClientTreeView .ExpandedChanging )ASPxTreeView.ExpandedChanging (via MVCxTreeView .ExpandedChanging )
After actionASPxClientTreeView.ExpandedChanged (via MVCxClientTreeView .ExpandedChanged )ASPxTreeView.ExpandedChanged (via MVCxTreeView .ExpandedChanged )