Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

#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();
    }
}

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