Skip to main content

DxGridSelectionColumn.AllowSelectAll Property

Specifies whether the selection column contains the Select All checkbox.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(true)]
[Parameter]
public bool AllowSelectAll { get; set; }

Property Value

Type Default Description
Boolean true

true if the selection column contains the Select All checkbox; otherwise, false.

Remarks

When the SelectionMode property is set to Multiple (the default value), the selection column displays checkboxes. A user can click the checkbox in the header cell to select or deselect all rows on the current page or on all grid pages depending on the SelectAllCheckboxMode property value.

Blazor Grid Selection Column Select All

View Example: Select and Deselect All Rows in a Group

Disable the AllowSelectAll option to hide the Select All checkbox from the header cell.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="GridDataSource"
        @bind-SelectedDataItems="@SelectedDataItems"
        KeyFieldName="ProductId">
    <Columns>
        <DxGridSelectionColumn AllowSelectAll="false"/>
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="QuantityPerUnit" />
        <DxGridDataColumn FieldName="UnitsInStock" />
    </Columns>
</DxGrid>

@code {
    IEnumerable<object> GridDataSource { get; set; }
    NorthwindContext Northwind { get; set; }
    IReadOnlyList<object> SelectedDataItems { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        GridDataSource = Northwind.Products.ToList();
        SelectedDataItems = GridDataSource.Skip(1).Take(2).ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Blazor Grid Selection Column

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

Implements

See Also