Skip to main content

DxTreeViewNode.Expanded Property

Specifies whether the node is expanded.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(false)]
[Parameter]
public bool Expanded { get; set; }

Property Value

Type Default Description
Boolean false

true if the node is expanded; false if the node is collapsed.

Remarks

Use the Expanded property to expand or collapse the node. Handle the ExpandedChanged to react to the node’s expansion or collapse.

The following code snippet expands the Data Editors node:

<DxTreeView>
    <Nodes>
        <DxTreeViewNode Name="Overview" Text="Overview" NavigateUrl="https://demos.devexpress.com/blazor/" />
        <DxTreeViewNode Name="Editors" Text="Data Editors" Expanded="true">
            <Nodes>
                <DxTreeViewNode Text="Combobox" NavigateUrl="https://demos.devexpress.com/blazor/ComboBox" Target="_blank" />
                <DxTreeViewNode Text="Spin Edit" NavigateUrl="https://demos.devexpress.com/blazor/SpinEdit" />
            </Nodes>
        </DxTreeViewNode>
        <DxTreeViewNode Name="FormLayout" Text="Form Layout" NavigateUrl="https://demos.devexpress.com/blazor/FormLayout" BadgeText="Upd" />
        <DxTreeViewNode Name="TreeView" Text="TreeView" NavigateUrl="https://demos.devexpress.com/blazor/TreeView" BadgeText="New"  />
        <DxTreeViewNode Name="Tabs" Text="Tabs" NavigateUrl="https://demos.devexpress.com/blazor/Tabs" Visible="false" BadgeText="New" />
    </Nodes>
</DxTreeView>

TreeView Node Collection

To expand or collapse all nodes, use the ExpandAll() and CollapseAll() methods.

See Also