Filter API with multiple values

I've got a DropDown used as a Filter Template on a new DataGrid. This DropDown is bound to a Page Property which is also used as the data grid column's filtervalue (I'm using the filter API). All works fine with single selections but, the end-user has reqeusted the ability to select multiple filter values.

Are there any examples of this as I am struggling to get this to work.

I enable multiple selections on the DropDown in the Filter Template and change the type of the page property from string to IEnumerable<string> and I hit C# exceptions such as:

Note: I am not using ToLower in my code...

Hi @markb,

DataGrid column FilterValue can only with single value.

Hi @enchev,

That explains my issue :slight_smile: Is there a recommended way to achieve filtering where a user can select more than one option to filter on? In Angular, the query builder has an "In list" option but, there isn't an equivalent when using Blazor..

I can get the selected options into a either a list or a comma seperated string without any issues but, I'm not sure how to use one of these within Radzen to apply the required filter. I thought the FilterValue was the way to go but, that appears to be an incorrect line of thought on my part!

Thanks!

Hi @markb,

At the moment such option is not supported in our Blazor DataGrid however we will do our best to provide it at some point. In the meantime the only option will be to filter the collection bound to Data property - i.e. not using the built-in filters.

You can also check my reply in this thread: Is datagrid able filter by DropDown multiselect? - #3 by korchev

Hi @korchev,

Thanks for the pointer! I've managed to adapt your demo to my scenario and have it working with a multi-select. The only downside appears to be the performance. My page opens and retrieves the initial data virtually instantly (using Radzen's invoke data source method and binding the DataGrid to the result to a page property).

If I change the multi-select filter (which calls the routine to execute the LINQ on the page property) it seems to take 4 or 5 seconds to refresh the DataGrid. That might be a performance hit which we have to live with if that is currently the only way to achieve filtering on multiple values.