<RadzenDataGrid Responsive="true" ShowCellDataAsTooltip="LocalAppSate.ShowCellDataAsTooltip" @ref="@grid" Density="LocalAppSate.Density" AllowColumnResize="LocalAppSate.AllowColumnResize" IsLoading=IsLoading Count=@response.Data.TotalCount LoadData=@LoadData AllowSorting=true Data="@response.Data.Items" AllowFiltering="true" AllowPaging="true" PageSize="@requestInput.MaxResultCount" PagerHorizontalAlign="HorizontalAlign.Center">
<Columns>
<RadzenDataGridColumn Property="ShortName" Title="Short Name" />
<RadzenDataGridColumn Property="UnitType" Title="Unit Type" />
</Columns>
</RadzenDataGrid>
We have a unit type defined as:
public enum UnitTypeEnum
{
Mass = 10,
Length = 20
}
When applying a filter in the UI, it generates a filter like this:
x => (x.UnitType == (UnitTypeEnum)10)
Our backend uses:
System.Dynamic.Linq.Core
However, this throws the following exception:
Type 'Core.Enums' not found
Type 'Core.Enums' not found (at index 56)
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAsEnumOrNestedClass(String id)
It works correctly when we pass the filter like this:
x => (x.UnitType == 10)
instead of:
x => (x.UnitType == (UnitTypeEnum)10)
how can we just generate like this
x => (x.UnitType == 10)
instead of:
x => (x.UnitType ==(UnitTypeEnum) 10)