Skip to main content
A newer version of this page is available. .

TreeList.CollapseToLevel(Int32) Method

Collapses all nodes at the specified and subsequent levels.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.1.dll

Declaration

public void CollapseToLevel(
    int level
)

Parameters

Name Type Description
level Int32

A System.Int32 value that specifies the level starting from which nodes should be collapsed. 0 to collapse nodes starting from the root.

Remarks

The TreeList displays data in a hierarchical structure using nodes (TreeListNode objects). The hierarchical level of a certain TreeListNode can be obtained with the TreeListNode.Level property. Nodes can be expanded to display nested nodes, and collapsed afterwards. To expand\collapse a particular node in code, use the TreeListNode.Expanded property.

The CollapseToLevel method collapses nodes starting from the specified level. For instance, calling the CollapseToLevel method with the level parameter set to 0, collapses all nodes.

See Also