DxGridSelectionColumn.FilterRowCellTemplate Property
Specifies a template for the selection column’s filter row cell.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment<GridSelectionColumnFilterRowCellTemplateContext> FilterRowCellTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<GridSelectionColumnFilterRowCellTemplateContext> | The template for the selection column’s filter row cell. |
Remarks
A selection column allows users to select and deselect rows. This column contains checkboxes or radio buttons depending on selection mode.
The selection column’s cell located in the filter row is empty. You can define the FilterRowCellTemplate
to display custom content in this cell. Use the template’s context
parameter to access SelectionColumn and Grid objects.
The following code snippet hides the predefined Select All checkbox from the selection column header and display the custom Select All button in the filter row cell.
@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable
<DxGrid Data="GridDataSource"
@bind-SelectedDataItems="@SelectedDataItems"
KeyFieldName="ProductId"
@ref="MyGrid"
ShowFilterRow="true">
<Columns>
<DxGridSelectionColumn AllowSelectAll="false">
<FilterRowCellTemplate>
<DxButton Click="() => MyGrid.SelectAllOnPage()" Text="Select All"
RenderStyle="ButtonRenderStyle.Link" />
</FilterRowCellTemplate>
</DxGridSelectionColumn>
<DxGridDataColumn FieldName="ProductName" Width="250"/>
<DxGridDataColumn FieldName="UnitPrice" />
<DxGridDataColumn FieldName="QuantityPerUnit" />
<DxGridDataColumn FieldName="UnitsInStock" />
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="false"
EditButtonVisible="false" />
</Columns>
</DxGrid>
@code {
IEnumerable<object> GridDataSource { get; set; }
NorthwindContext Northwind { get; set; }
IReadOnlyList<object> SelectedDataItems { get; set; }
IGrid MyGrid { 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();
}
}
For more information, refer to the following topics: