DataGrid filtering fails when using FilterProperty and custom FilterTemplate with DropDown #1400

Closed
opened 2026-01-29 17:53:12 +00:00 by claunia · 1 comment
Owner

Originally created by @isak1080 on GitHub (Sep 23, 2024).

Describe the bug
Somewhere inside radzen there is an exception as soon as I select a filter value from a dropdown. I've narrowed it down to when I'm using:

  • A custom FilterTemplate with a RadzenDropDown allowing me to select one or more items from a list of options
  • The column has FilterProperty set to something else than Property (Even if they contain the same value in the underlying model)

To Reproduce
Based on the example over here: https://blazor.radzen.com/datagrid-filter-template

  1. Add a read only property on Employee called CompanyName2. Make it return the value of CompanyName (public string CompanyName2 => CompanyName;)
  2. Modify the customer column by adding FilterProperty="CompanyName2"
  3. Run
  4. Try to filter on "Customer" - app will crash

Expected behavior
Expect filter to work

Screenshots
I get this exception:

System.NotSupportedException: Specified method is not supported.
   at Radzen.Blazor.DynamicLinqCustomTypeProvider.GetExtensionMethods()
   at System.Linq.Dynamic.Core.Parser.SupportedMethods.MethodFinder.FindMethod(Type type, String methodName, Boolean staticAccess, Expression& instance, Expression[]& args, MethodBase& method)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAsLambda(String id)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIdentifier()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArguments()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArgumentList()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator()
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args)
   at Radzen.QueryableExtension.Where[T](IQueryable`1 source, IEnumerable`1 columns)
   at Radzen.Blazor.RadzenDataGrid`1.get_View()
   at Radzen.PagedDataBoundComponent`1.get_PagedView()
   at Radzen.Blazor.RadzenDataGrid`1.DrawGroupOrDataRows(RenderTreeBuilder builder, IList`1 visibleColumns)
   at Radzen.Blazor.RadzenDataGrid`1.<>c__DisplayClass20_0.<DrawRows>b__0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Radzen.Blazor.RadzenDataGrid`1.<BuildRenderTree>b__653_0(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

Desktop (please complete the following information):

  • OS: Windows
  • Browser: All (tested chrome and edge, latest versions)
  • Version: all
Originally created by @isak1080 on GitHub (Sep 23, 2024). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** Somewhere inside radzen there is an exception as soon as I select a filter value from a dropdown. I've narrowed it down to when I'm using: - A custom `FilterTemplate` with a `RadzenDropDown` allowing me to select one or more items from a list of options - The column has `FilterProperty` set to something else than `Property` (Even if they contain the same value in the underlying model) **To Reproduce** Based on the example over here: https://blazor.radzen.com/datagrid-filter-template 1. Add a read only property on `Employee` called `CompanyName2`. Make it return the value of `CompanyName` (`public string CompanyName2 => CompanyName;`) 2. Modify the customer column by adding `FilterProperty="CompanyName2"` 3. Run 4. Try to filter on "Customer" - app will crash **Expected behavior** Expect filter to work **Screenshots** I get this exception: ``` System.NotSupportedException: Specified method is not supported. at Radzen.Blazor.DynamicLinqCustomTypeProvider.GetExtensionMethods() at System.Linq.Dynamic.Core.Parser.SupportedMethods.MethodFinder.FindMethod(Type type, String methodName, Boolean staticAccess, Expression& instance, Expression[]& args, MethodBase& method) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAsLambda(String id) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIdentifier() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArguments() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArgumentList() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression) at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator() at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args) at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args) at Radzen.QueryableExtension.Where[T](IQueryable`1 source, IEnumerable`1 columns) at Radzen.Blazor.RadzenDataGrid`1.get_View() at Radzen.PagedDataBoundComponent`1.get_PagedView() at Radzen.Blazor.RadzenDataGrid`1.DrawGroupOrDataRows(RenderTreeBuilder builder, IList`1 visibleColumns) at Radzen.Blazor.RadzenDataGrid`1.<>c__DisplayClass20_0.<DrawRows>b__0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at Radzen.Blazor.RadzenDataGrid`1.<BuildRenderTree>b__653_0(RenderTreeBuilder __builder2) at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) ``` **Desktop (please complete the following information):** - OS: Windows - Browser: All (tested chrome and edge, latest versions) - Version: all
Author
Owner

@enchev commented on GitHub (Sep 24, 2024):

Fixed in 2b2b48bec4

@enchev commented on GitHub (Sep 24, 2024): Fixed in https://github.com/radzenhq/radzen-blazor/commit/2b2b48bec432e5a2076cca73144e65757ed40061
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1400