When adding rows to my data source, (if items per page is set to 5) when I reach 6 rows in the table the page size and settings template becomes null and pagination stops working until the the grid is re-rendered by clicking refresh. I attempted to call changedatasource() on the row save event without passing a parameter this worked to fix the pagination issue however the sorting of the data is lost. How can I reset the pager without re-rendering the grid?
Hi Zach Tumbusch,
Greetings from the Syncfusion
support,
We noticed that a grid with a pageSize of 5, when adding a 6th row to the grid, it becomes null and pagination stops working. We attempted to create a sample based on your requirement. However, we are unable to find the issue you mentioned.
Sample : 84ctkx
(forked) - StackBlitz
If you are still experiencing a problem, please provide
the following information:
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Johnson Soundararajan S
It sounds like the pager state isn’t being refreshed when the data source changes dynamically. Instead of calling changeDataSource() without parameters (which resets sorting), try using refresh() or refreshPager() after updating the data source to keep the current sort settings intact. You can also reassign the same dataSource reference after updating the array to trigger proper state tracking. Think of it like applying a photobooth filter you want to refresh the view without changing the original structure underneath.
Encountering pagination problems can be frustrating! It sounds like your data source is outgrowing your initial pagination setup. Have you tried explicitly recalculating the pager state after data changes? Perhaps a little code tweak, like navigating the Google Snake cleverly to eat more apples (data), will trigger a refresh internally without losing sorting. Let me know if you've explored specific pager methods; maybe we can help debug!