Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTreeList.AutoExpandAllNodes Property

Specifies whether to automatically expand all nodes when the TreeList loads data.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(false)]
[Parameter]
public bool AutoExpandAllNodes { get; set; }

#Property Value

Type Default Description
Boolean false

true to expand all nodes; otherwise, false.

#Remarks

Enable the AutoExpandAllNodes property to expand all TreeList nodes in the following cases:

  • When the TreeList component initially loads data.
  • When you call the Reload() method.
  • When the Data property value changes.
  • When the RootValue property value changes.

Note

The TreeList component bound to a GridDevExtremeDataSource<T> ignores the AutoExpandAllNodes property.

In the following example, the TreeList component automatically expands all rows after data loading operations:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" AutoExpandAllNodes="true">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    List<EmployeeTask> TreeListData { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
}

Call the ExpandAll or CollapseAll method to expand or collapse all rows in the TreeList component. To expand or collapse a specific row, pass the row’s visible index to the ExpandRow or CollapseRow method. The IsRowExpanded(Int32) method returns whether a row with the specified visible index is expanded.

#Implements

See Also