Function ToFilterString() add full classname when filtering an enum value. #1865

Closed
opened 2026-01-29 17:59:32 +00:00 by claunia · 3 comments
Owner

Originally created by @emmanuelUB on GitHub (Sep 19, 2025).

Describe the bug
Since version 7.0.0, function ToFilterString() on a RadzenGrid behave differently when filtering enum.
The filter now contains the fullname of the class as casting causing DynamicLinq library to fail when parse it.
An exemple : "x => (x.State == (AcmeCorp.MyNameSpace.Models.State)0)"

To Reproduce
Steps to reproduce the behavior:

  1. Create a RadzenGrid
  2. Add a column bind to an enum
    <RadzenDataGridColumn TItem=Order Property="@nameof(State)" Title="State" Width="160px" FilterValue="@currentState"> <FilterTemplate> <RadzenDropDown @bind-Value="@currentState" Style="width:100%;" TextProperty="Text" ValueProperty="Value" AllowClear="true" Data="@(Enum.GetValues(typeof(State)).Cast<State?>() .Select(t => new { Text = $"{t}", Value = t }))"> </RadzenDropDown> </FilterTemplate> </RadzenDataGridColumn>
  3. Change the value of the dropdownlist
  4. Check the value of grid.ColumnsCollection.ToFilterString()

Expected behavior
Can we remove or make optionnal the addition of the class fullname ?

Additional context
Checked in dynamic linq if it's possible to add custom types, we can but it was not taken in consideration.

Originally created by @emmanuelUB on GitHub (Sep 19, 2025). **Describe the bug** Since version 7.0.0, function ToFilterString() on a RadzenGrid behave differently when filtering enum. The filter now contains the fullname of the class as casting causing DynamicLinq library to fail when parse it. An exemple : "x => (x.State == (AcmeCorp.MyNameSpace.Models.State)0)" **To Reproduce** Steps to reproduce the behavior: 1. Create a RadzenGrid 2. Add a column bind to an enum ` <RadzenDataGridColumn TItem=Order Property="@nameof(State)" Title="State" Width="160px" FilterValue="@currentState"> <FilterTemplate> <RadzenDropDown @bind-Value="@currentState" Style="width:100%;" TextProperty="Text" ValueProperty="Value" AllowClear="true" Data="@(Enum.GetValues(typeof(State)).Cast<State?>() .Select(t => new { Text = $"{t}", Value = t }))"> </RadzenDropDown> </FilterTemplate> </RadzenDataGridColumn>` 3. Change the value of the dropdownlist 4. Check the value of grid.ColumnsCollection.ToFilterString() **Expected behavior** Can we remove or make optionnal the addition of the class fullname ? **Additional context** Checked in dynamic linq if it's possible to add custom types, we can but it was not taken in consideration.
Author
Owner

@enchev commented on GitHub (Sep 23, 2025):

I'm afraid that we cannot do that since it will not be valid for plain C# parsers like our own, after we abandoned the Dynamic LINQ library due to vulnerability issues. There are other differences as well (it's not only the fully qualified name of the enums). They do not support normal C# casting, they use a different syntax for conversion—not the standard C# one, etc.

@enchev commented on GitHub (Sep 23, 2025): I'm afraid that we cannot do that since it will not be valid for plain C# parsers like our own, after we abandoned the Dynamic LINQ library due to vulnerability issues. There are other differences as well (it's not only the fully qualified name of the enums). They do not support normal C# casting, they use a different syntax for conversion—not the standard C# one, etc.
Author
Owner

@emmanuelUB commented on GitHub (Sep 23, 2025):

@enchev : understand your position ! By any chance, do you know any librairy we can use that is compliant to your syntax and fit with entity framework ? Thanks

@emmanuelUB commented on GitHub (Sep 23, 2025): @enchev : understand your position ! By any chance, do you know any librairy we can use that is compliant to your syntax and fit with entity framework ? Thanks
Author
Owner

@enchev commented on GitHub (Sep 23, 2025):

It’s a plain C# and our library works directly with EF. Both classes works directly with LINQ expression trees:
https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/ExpressionParser.cs
https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/ExpressionSerializer.cs

@enchev commented on GitHub (Sep 23, 2025): It’s a plain C# and our library works directly with EF. Both classes works directly with LINQ expression trees: https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/ExpressionParser.cs https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/ExpressionSerializer.cs
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1865