windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-dot-collapse-x28-system-dot-boolean-x29.md
Collapses the node.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
public void Collapse(
bool animate = false
)
Public Sub Collapse(
animate As Boolean = False
)
| Name | Type | Default | Description |
|---|---|---|---|
| animate | Boolean | False |
true to collapse the node with animation; otherwise, false.
|
Use the methods below to expand and collapse tree list nodes.
TreeList.ExpandAll—expands all nodes.
TreeList.CollapseAll—collapses all nodes.
TreeList.ExpandToLevel(System.Int32)—expands nodes up to the specified level. The zeroth level corresponds to root nodes. To obtain a node’s level, use the TreeListNode.Level property.
TreeList.CollapseToLevel(System.Int32)—collapses all nodes at the specified and subsequent levels.
TreeListNode.ExpandAll—expands the node’s child nodes.
TreeListNode.CollapseAll—collapses the node’s child nodes.
TreeListNode.Expand—expands this node. Use the TreeListNode.HasChildren property to check if a node has child nodes that can be expanded or collapsed.
TreeListNode.Collapse—collapses this node.
The control’s BeforeExpand, AfterExpand, BeforeCollapse, and AfterCollapse events fire during expand and collapse operations. For example, you can handle the BeforeExpand event to dynamically create child nodes in unbound mode.
See Also