Skip to main content
All docs
V24.1

DxTreeList.SelectAllCheckboxMode Property

Specifies whether the Select All checkbox selects all rows on the current page or on all TreeList pages.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(TreeListSelectAllCheckboxMode.Page)]
[Parameter]
public TreeListSelectAllCheckboxMode SelectAllCheckboxMode { get; set; }

Property Value

Type Default Description
TreeListSelectAllCheckboxMode Page

An enumeration value.

Available values:

Name Description
Page

The Select All checkbox does not affect child rows of collapsed items and selects/deselects rows on the current page only.

AllPages

The Select All checkbox affects child rows of collapsed items and selects/deselects all rows on all pages.

Mixed

The Select All checkbox does not affect child rows of collapsed items and selects/deselects rows on the current page only. An additional drop-down button displays a context menu that allows users to select and deselect all rows on all pages.

Remarks

The DevExpress Blazor TreeList supports single and multiple row selection. Users can click rows or use a dedicated column to select/deselect records. To add a selection column to the TreeList, declare the DxTreeListSelectionColumn object in the Columns template.

The selection column header displays the Select All checkbox. Use the TreeList’s SelectAllCheckboxMode property to specify whether to select only visible rows on the current page or all rows on all TreeList pages. Note that the checkbox does not affect rows hidden by the filter.

TreeList Select All Checkbox

Run Demo: TreeList - Multiple Row Selection

When the SelectionMode property is set to Single, the Select All checkbox is hidden and the SelectAllCheckboxMode property has no effect. To hide the Select All checkbox in multiselect mode, set the AllowSelectAll property to false.

Use the SelectedDataItems property to access data items that correspond to selected rows. Call the SelectAllOnPage or SelectAllAsync methods to change the selection state of rows on the current page or on all TreeList pages, respectively.

Specifics and Limitations

When the TreeList component is in virtual scrolling mode, the Page mode automatically switches to AllPages mode.

The Mixed mode is designed to improve performance. The TreeList switches to this mode when it is bound to the GridDevExtremeDataSource or loads data on demand and one of the following conditions is met:

The TreeList component cannot determine the Select All checkbox state when the vertical virtual scrolling mode is activated and the checkbox is in Mixed mode. In such a case, the TreeList sets the Select All checkbox state to indeterminate and displays the checkbox in read-only mode.

Example

The following code snippet switches the Select All checkbox to AllPages mode:

@inject EmployeeTaskService EmployeeTaskService

<DxTreeList Data="TreeListData"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            SelectAllCheckboxMode="TreeListSelectAllCheckboxMode.AllPages">
    <Columns>
        <DxTreeListSelectionColumn />
        <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();
    }
}

For more information about selection in the TreeList component, refer to the following topic: Selection and Focus in Blazor TreeList.

See Also