I am trying to do a custom filter as FilterMenuTemplate in a Grid.
Filtering works fine. When I attempt to "unfilter", I get lost in how to detect and handle it.
I have two different styles of handing the filtering in the below, yet neither can I get to work.
How do I have FilterMenuTemplate with a dropdown (custom) and detect the user clicking the "Clear" button?
<TelerikGrid Data="@_vehicleParts"
Pageable="true"
Sortable="true"
FilterMode="Telerik.Blazor.GridFilterMode.FilterMenu"
Resizable="true"
Reorderable="true"
PageSize="20"
Navigable="true"
OnRead=@OnVehiclePartsRead
TotalCount="@TotalCount">
<GridColumns>
<GridColumn Width="10%" Field="@nameof(VehiclePartModel.YearId)">
</GridColumn>
<GridColumn Width="10%" Field="@nameof(VehiclePartModel.BrandModelName)">
<FilterMenuTemplate Context="brandModelNameFilterContext">
<TelerikDropDownList Data="@_brandModels" TextField="@nameof(BrandModel.Name)" ValueField="@nameof(BrandModel.Id)" @bind-Value="@BrandModelIdFilter" />
</FilterMenuTemplate>
</GridColumn>
<GridColumn Width="10%" Field="@nameof(VehiclePartModel.MakeName)">
<FilterMenuTemplate Context="makeNameFilterContext">
@{ this._makeNameFilterContext = makeNameFilterContext;}
<TelerikDropDownList Data="@_makes" TextField="@nameof(Make.Name)" Value="@MakeIdFilter" ValueField="@nameof(Make.Id)" ValueChanged="@((int value) => ColumnValueChanged(value, nameof(VehiclePartModel.MakeName), makeNameFilterContext.FilterDescriptor))"/>
</FilterMenuTemplate>
</GridColumn>