I have a RadzenDataGrid configured to work with OData-style filtering. In some specific cases, I need to handle filtering manually in the LoadData event using IQueryable, like this:
query = query.Where(args.Filter);
This worked without issues in Radzen.Blazor v5, but after upgrading to v7, I now get the following error when the grid tries to apply the filter:
name eq "john" type of filters working with System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where That referred on old version. but it is not working with new filtering logic in Radzen
Hi @enchev, Sorry if I misunderstood. Here's the code I’ve been using — it worked previously when there're Linq.Dynamic.Core dependencies:
var externalFilter = "name eq 'John'";
if (!string.IsNullOrEmpty(externalFilter))
{
query = query.Where(externalFilter);
}
However, after updating to the later version of Radzen, this no longer works unless I explicitly reference System.Linq.Dynamic.Core.DynamicQueryableExtensions like this:
var externalFilter = "name eq 'John'";
if (!string.IsNullOrEmpty(externalFilter))
{
query = System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(query, externalFilter);
}
This works, but I’d prefer not to rely on System.Linq.Dynamic.Core library. I want to keep the code consistent and continue using Radzen’s built-in filtering support.
These are OData expressions - even if they worked with Dynamic LINQ library (honestly, I never knew that) we never supported such case intentionally.
The valid C# expression for filtering in-memory data or any other IQueryable provider should be: