Persistence Error when filtering by Enum

Hi there, 

I have an issue where I have a grid column with a enum data type. I am able to filter by enum when I first filter, but when I enable persistence, I get an exception thrown from my API. I have figured out that this is due to a $filter request for the integer value of the enum, and not the field "string." I have a screen shot of the issue below. Here, I have a enum called SourceType, with a field Custom = 5. I'm using OData.


The Request when first loaded works, but not when reloaded. 
This is the code from the SFGrid.


Any thoughts on how to get this to work? 

8 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team April 30, 2021 11:40 AM UTC

Hi Oscar, 

Greetings from Syncfusion support. 

We checked this scenario by creating a sample in our latest version to perform filtering for enum column with EnablePersistence in Grid. But we could not face the reported problem from our side, and filtering works fine with the sample from our side. Please download and refer the sample from the link below, 
 
We would like to inform you that we have resolved an issue related to EnablePersistence and  filtering in our latest version 19.1.0.57. Please find the release notes from the link below, 
 
So we suggest you to check this scenario by upgrading to our latest version 19.1.0.58. And if you are still facing this reported problem after upgrading to latest version, then the following details would be helpful for us to proceed further. 

  1. Share the details regarding whether you are dynamically enabling the EnablePeristence property?
  2. Share with us a video demo showing the problem you are facing.
  3. Share the Syncfusion version details you are using.
  4. Share the complete Grid rendering codes.
  5. Share the exact scenario you are facing this problem.
  6. Share the exception details you are facing.

Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Marked as answer

OL Oscar Lee May 13, 2021 07:14 PM UTC

Hi Renjith, 

Thanks for the response. I tried to mimic your sample and still came across some issues. I don't have any issues when I first filter, only when I reload with persistence. The odata call is different per the image I have in a previous post. I'm curious if there is a way to customize the way you load the grid when persistence is enabled in order to force the odata call to be $filter=(SourceType%20eq%20%27Custom%27) instead of $filter=(SourceType%20eq%205).

I'm using Syncfusion version 19.1.0.59.



RS Renjith Singh Rajendran Syncfusion Team May 18, 2021 09:04 AM UTC

Hi Oscar, 

We have confirmed it as a bug and logged the defect report Problem with enum column filtering in ODataV4Adaptor with EnablePersistence” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our weekly release which is expected to be rolled out by the mid of June, 2021.  
       
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       
 
Regards, 
Renjith R 



OL Oscar Lee May 21, 2021 12:53 PM UTC

Hi Renjith, 

Looks like I don't have permission to view that page. Is there any way I can get access?

Best,
Oscar


RS Renjith Singh Rajendran Syncfusion Team May 24, 2021 12:05 PM UTC

Hi Oscar, 

Sorry for the inconvenience. We have provided access to the feedback. Kindly try accessing now. 

Regards, 
Renjith R 



IN Ingo December 19, 2022 09:03 PM UTC

Hello together, i am now facing the same problem as mention 2 years ago.

If I switch on the persistence on the DataGrid with a DataManager and a filter is set on an enum column, this works without problems, because it filters according to the StringValue. If I now leave the page and come back, no content is displayed anymore, because now it tries to filter with the int Value of the Enum - if I now click on the CheckboxFilterMenu an exception is thrown.

I think i also found the problem - you are saving the value as the index so in my case in my localstorage i found 4 instead of 'Bezahlt'. Is there a possibility to change it by my self or could you update this?


First time filter is set:

$filter: ((Status ne 'Bezahlt') and (Status ne 'Storniert'))

Coming back to the page:

$filter: ((Status ne 2) and (Status ne 4))


Can you please take a look at this? As long i have to disable persistence sadly...

Kind regards,
Ingo



SP Sarveswaran Palani Syncfusion Team December 22, 2022 04:17 AM UTC

Hi Ingo,


We have validated and considered your query as a bug and logged the defect report “Exception on Filtering the persisted Enum Value” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and will include the fix in any of our upcoming patch release.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link. 


https://www.syncfusion.com/feedback/39962/exception-on-filtering-the-persisted-enum-value


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization”


Until then we appreciate your patience.


Regards,

Sarvesh



VN Vignesh Natarajan Syncfusion Team February 16, 2023 04:51 AM UTC

Hi Ingo,

We are glad to announce that, we have included fix for the issue “Exception on Filtering the persisted Enum Value” in our latest patch release . So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package for latest fixes and features from below.


Nuget : https://www.nuget.org/packages/Syncfusion.Blazor.Grid


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 


Please let us know if you have any concerns.


Regards,

Vignesh Natarajan



Loader.
Up arrow icon