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

TreeListNode.Expanded Property

Gets or sets whether the node is expanded.

Namespace: DevExpress.XtraTreeList.Nodes

Assembly: DevExpress.XtraTreeList.v19.1.dll

Declaration

[DefaultValue(false)]
[DXCategory("Behavior")]
public virtual bool Expanded { get; set; }

Property Value

Type Default Description
Boolean **false**

true, if the node is expanded; otherwise, false.

Remarks

Set the Expanded property to true to display child nodes of the current node. If set to false, the current node collapses and all its child nodes are hidden.

using DevExpress.XtraTreeList.Nodes;

TreeListNode node = treeList1.GetNodeByVisibleIndex(0);
node.Expanded = !node.Expanded;

If the TreeListNode.HasChildren property is set to false, setting the Expanded property to true does nothing. When the TreeListNode.HasChildren property is set to true, setting the TreeListNode.Expanded property to true causes the Tree List to fire the TreeList.BeforeExpand event. It allows the dynamic loading feature to be implemented in unbound mode.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Expanded property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also