DxGrid.SelectAllCheckboxMode Property
Specifies whether the Select All checkbox selects all rows on the current page or on all grid pages.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(GridSelectAllCheckboxMode.Page)]
[Parameter]
public GridSelectAllCheckboxMode SelectAllCheckboxMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
GridSelectAllCheckboxMode | Page | The selection mode. |
Available values:
Name | Description |
---|---|
Page | The Select All checkbox selects and deselects all rows on the current grid page. This mode changes to |
AllPages | The Select All checkbox selects and deselects all rows on all grid pages. This mode changes to |
Mixed | The Select All checkbox selects and deselects all rows on the current grid page. An additional drop-down button displays a context menu that allows users to select and deselect all rows on all grid pages. |
Remarks
The DevExpress Blazor Grid supports single and multiple row selection. Users can click rows or use a specially-designed column to select/deselect records. To add a selection column to the Grid, declare the DxGridSelectionColumn object in the Columns template.
The selection column header displays the Select All checkbox. Use the Grid’s SelectAllCheckboxMode
property to specify whether the checkbox selects all rows on the current page or on all grid pages. Note that the checkbox does not affect rows hidden by the filter.
When the SelectionMode property is set to Single
, the Select All check box is hidden and the SelectAllCheckboxMode
property has no effect. To hide the Select All checkbox in multi select 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 all rows on the current page or on all grid pages, respectively.
Specifics and Limitations
When the Grid component displays all items on one page, Page
and AllPages
modes function identically.
Mixed
mode is designed to improve performance. The Grid switches to this mode when the Grid is bound to a large data source and one of the following conditions is met:
- The
SelectAllCheckboxMode
property is set toAllPages
. - The Grid is in vertical virtual scrolling mode.
The Grid component cannot determine the Select All checkbox state when vertical virtual scrolling mode is activated and the checkbox is in Mixed
mode. In such a case, the Grid sets the Select All checkbox state to indeterminate and displays the checkbox in read-only mode.
Example
The following code snippet switchs the Select All checkbox to AllPages
mode:
<DxGrid Data="Products"
KeyFieldName="ProductId"
PageSize="6"
SelectAllCheckboxMode="GridSelectAllCheckboxMode.AllPages">
<Columns>
<DxGridSelectionColumn />
<DxGridDataColumn FieldName="ProductName" />
<DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c" />
<DxGridDataColumn FieldName="UnitsInStock" />
<DxGridDataColumn FieldName="QuantityPerUnit" />
</Columns>
</DxGrid>
For more information about selection in the Grid component, refer to the following topic: Selection and Focus in Blazor Grid.