Data Grid Search Error for column type Enum

When we apply server side filtering and try to search the Column of type Enum using Perform Searching it is throwing error. 


System.InvalidOperationException: 'The LINQ expression 'DbSet<tblStockDepart>()

    .Where(t => (t.col1 ?? "Blanks").ToLower().Contains("search") 

could not be translated. 

Additional information: Translation of method 'System.Enum.ToString' failed.


Enum toString Failed because from searching we are passing String and when PERFORM SEARCHING() called server side it does to convert back to enum it treat column as string but actually its enum.

What could be the solution for this ? any workaround ? 


1 Reply 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team September 20, 2022 03:02 PM UTC

Hi Hiral,


Thanks for contacting Syncfusion support.


By default, the EJ2 Grid column only supports number, string, date, dateTime, Boolean, checkbox type values, and which does not supports Enum, array type of values. Refer to the below documentation.


columnType: https://ej2.syncfusion.com/documentation/api/grid/columnType/ 


So, the Grid does not support any data actions like Filtering, Sorting, Editing, Searching, Grouping, etc., on the Enum type of column. This is the behavior of EJ2 Grid.


Regards,

Rajapandiyan S


Marked as answer
Loader.
Up arrow icon