Skip to main content
A newer version of this page is available. .

DxGridSelectionColumn.FilterRowCellTemplate Property

Specifies a template for the selection column’s filter row cell.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.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 the SelectionColumn and Grid objects.

The example below demonstrates how to hide 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();
    }
}

Blazor Grid Selection Column Filter Row Cell

View Example: How to implement filter operator selector

For more information, refer to the following topics:

See Also