Skip to main content

TreeListNode.Expanded Property

Gets or sets whether the node is expanded.

Namespace: DevExpress.XtraTreeList.Nodes

Assembly: DevExpress.XtraTreeList.v22.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

Use the methods below to expand and collapse tree list nodes.

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.

Example

The code below changes the first visible node’s expand state.

using DevExpress.XtraTreeList.Nodes;

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