Duplicated
Last Updated: 15 Sep 2023 10:52 by ADMIN
Adrian
Created on: 09 Sep 2023 11:03
Category: Grid
Type: Bug Report
0
Issue with Telerik Grid State Caching and Filtering
 

**Description**:
I've encountered an issue with the Telerik Grid component in Blazor where caching the grid state, specifically the filtering state, leads to a casting exception upon reloading the page.

**Steps to Reproduce**:
1. Set up a Telerik Grid with a nullable enum column (e.g., `LeadStatuses? Status`).
2. Apply a filter to the `Status` column.
3. Save the grid state (including the filter state) to cache.
4. Refresh the browser.
5. Load the grid state from cache and apply it to the grid.

**Expected Behavior**:
The grid should load with the previously applied filter without any issues.

**Actual Behavior**:
A casting exception occurs, specifically: "Specified cast is not valid."

**Additional Information**:
- The issue seems to be related to filtering and saving state to the grid. When the column is removed, the error doesn't occur.
- Clearing the filter from the cached state for gid will work.
- The exact error message is: 
```
Unhandled exception rendering component: Specified cast is not valid.
 
Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
2 comments
ADMIN
Svetoslav Dimitrov
Posted on: 15 Sep 2023 10:52

Hello Adnan,

We have an open bug report regarding the Bug you have reported to us - Enum filter throws with state persistence to JSON. I have added your Vote for it and you can click the Follow button to receive email notifications on status updates. 

That being said, you can find additional information from the Admin edit in the aforementioned bug report and some workarounds.

I am marking this thread as a "Duplicate".

Regards,
Svetoslav Dimitrov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Adrian
Posted on: 09 Sep 2023 11:04
I can temporary fix it by clearing the filter from state