Search code examples
razorserverblazorsyncfusion

Syncfusion Blazor grid custom column filtering error


I want to have different filter settings on three grid columns. The first column has Menu filtering, the second column has FilterBar filtering, and the third column has Excel filtering.

<SfGrid DataSource="@Employees" AllowFiltering="true">
<GridColumns>
    <GridColumn Field="FirstName" HeaderText="First Name" FilterSettings="@(new FilterSettings() { Type = Syncfusion.Blazor.Grids.FilterType.Menu })"></GridColumn>
    <GridColumn Field="LastName" HeaderText="Last Name" FilterSettings="@(new FilterSettings() { Type = Syncfusion.Blazor.Grids.FilterType.FilterBar })"></GridColumn>
    <GridColumn Field="@nameof(childRecord.TEIDS_ID)" HeaderText="ID" FilterSettings="@(new FilterSettings() { Type = Syncfusion.Blazor.Grids.FilterType.Excel })"></GridColumn>
</GridColumns>

The Blazor web application shows all three of the columns with the same filtering option: FilterBar. I would like to fix this discrepancy.

FilterBar grid


Solution

  • Add <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings> or use either of Excel/CheckBox in place of Menu, except for FilterBar.

    They apparently do not allow mixing of FilterBar with other filter types according to this.