Endless loop SfGrid
Hi,
I have a really weird topic.
my applications stops randomly because of an endless log in the SfGrid, DataProcessChildContent (see attachment). I cannot see where this log starts from. Is there anything I can do to step this endless loop or enable and advanced logging or something else?
Currently we use the version 23.1.44 but it happens in 23.2.6 also.
Best Sven
Attachment: Screenshot_20231207_at_13.04.02_7f7344e9.zip
Hi Sven,
Greetings from Syncfusion.
Before proceeding further with your requirement. kindly share us the below details from your end.
- From your shared image it seems that the modelchanged is triggered continuously from ActionEvent argument. So kindly comment out the codes used inside the action events and check the reported issue.
- If you have used any Refresh method then kindly comment out the Refresh method and check the issue at your end.
- Share us the entire Grid code snippet.
- Share us the video demonstration of the issue.
- Share us the way you have binded data to Grid.
- If possible share us an simple issue reproduceable sample.
The above requested details will be very helpful for us to validate your requirement.
Regards,
Monisha
Hey, thanks for the quick response! We were able to fix our issue and this might be interessting for you:
What we do:
Our users can save their current grid views in our data base. For this we call Grid.GetPersistDataAsync from your SfGrid component.
Now the user can load his view from our data base and we call Grid.SetPersistDataAync.
In a rare case we went into an endless loop with the call stack:
DataProcess -> DataProcessChild -> DataProcessChildContent -> ModelChanged (as you can see in the screenshot in our opening post).
So i tried to find out why this happens and checked the following if statemante inDataProcessChildContent line 8033 in the compiled code
if (__nonvirtual (sfGrid1.AllowPaging) && (actionArgs != null && !actionArgs.RequestType.Equals((object) Action.Paging) || eventArgs != null && requestType == "Paging") && (sfGrid1.CurrentViewData == null || !sfGrid1.CurrentViewData.Any<object>()) && sfGrid1.TotalItemCount > 0 || __nonvirtual (sfGrid1.AllowPaging) && __nonvirtual (sfGrid1.EnablePersistence) && sfGrid1.TotalItemCount > 0 && (double) __nonvirtual (sfGrid1.PageSettings).CurrentPage > Math.Ceiling((double) sfGrid1.TotalItemCount / (double) __nonvirtual (sfGrid1.PageSettings).PageSize))
The issue was:
Grid.GetPersistDataAsync also hands out the pagesettings. A user from our system saved his view while being on page 2 of his grid view. The CurrentPage is saved in this settings.
When loading this view into the grid with
Grid.SetPersistDataAync.the application always crashed. This is because sfGrid1.CurrentViewData was empty. We had a page size of 25, the total count of elements was 26 and the current page to load was 2.
Maybe this is how you can reproduce and fix this issue. We now always set the CurrentPage to 1 when loading the view from our database.
Kind regards
P
Hi Patrick,
We are trying to replicate the reported issue at our end. In the meantime if possible kindly share us the entire Grid code snippet and also share us in which event you are getting the currentview data from DataGrid and in which event you have set the persisted data to Grid.
This will be very helpful for us to analyze the reported issue at our end.
Regards,
Monisha
- 3 Replies
- 3 Participants
-
SB Sven Boris Bornemann
- Dec 7, 2023 12:09 PM UTC
- Dec 18, 2023 07:25 AM UTC