TreeListNode.Expanded Property

Gets or sets whether the node is expanded.

Namespace: DevExpress.XtraTreeList.Nodes

Assembly: DevExpress.XtraTreeList.v20.1.dll

Declaration

[DefaultValue(false)]
[DXCategory("Behavior")]
public virtual bool Expanded { get; set; }
<DefaultValue(False)>
<DXCategory("Behavior")>
Public Overridable Property Expanded As Boolean

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.

See Also