I'm trying to follow the demo with the demo code:
<RadzenDataFilterProperty TItem="Order" Property="OrderID" Title="Order ID" FilterValue="@selectedIds"
Type="typeof(IEnumerable<int>)" FilterOperator="FilterOperator.Contains">
<FilterTemplate>
<RadzenDropDown @bind-Value=@selectedIds Style="width:100%;"
Change=@OnSelectedIdsChange Data="@(orderIds)" AllowClear="true" Multiple="true" />
</FilterTemplate>
</RadzenDataFilterProperty>
My implementation is:
<RadzenDataFilterProperty TItem="BookGridVM" Property="SubGenres" Title="SubGenres" FilterValue="@_selectedSubgenres"
Type="typeof(IEnumerable<string>)" FilterOperator="FilterOperator.Contains">
<FilterTemplate>
<RadzenDropDown @bind-Value=@_selectedSubgenres Style="width:100%;"
Change=@OnSelectedSubgenreChanged Data="@_subgenres" AllowClear="true" Multiple="true" />
</FilterTemplate>
</RadzenDataFilterProperty>
In my code block, I have:
IEnumerable<string> _subgenres { get; set; } = new List<string>();
IEnumerable<string> _selectedSubgenres;
Subgenres in the BookGridVM is a string.
My on change event follows the demo as far as I can tell.
void OnSelectedSubgenreChanged(object value)
{
if (_selectedSubgenres != null && !_selectedSubgenres.Any())
{
_selectedSubgenres = null;
}
}
I see the dropdown getting populated, but clicking a box doesn't filter the data set. For example in the screenshot below, if I clicked 'Action-Adventure', it should filter and show me at least the first object in the data list that has Action-Adventure listed as one of the subgenres. What am I missing to implement this?
