We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Infinite scroll in the "up" direction

The SfDataGrid as designed is very capable of handling infinite scrolling when scrolling down. There is also the ability to listen to scroll events to load more rows even before the last row is reached.

However, there is a use case when you need to load more rows when scrolling up and reaching the top items. Imagine a situation where you have a list where you start of the middle of a large data set and the user could "explore" in either direction. The user could scroll up to try and look backwards in the large dataset, and there needs to be a way to add more rows of data to the start of the data source when the user scrolls (close to) the top. There are a couple challenges with the current SfDataGrid for this use case:

  • There is no easy way to display a "loading more" type of widget at the top (right below the header and above the first row) while some future executes to actually load more data.
  • If you attempt to listen to scroll events to load more data when the top is reached, there is a problem with the scrolling behavior. If something prepends rows of data to the current data source, the current scroll position would reflect the top of the newly loaded (prepended) items (with scroll position still at the very top), instead of the scroll view appearing to remain in exactly the same position but now it's possible to scroll up more. Also, if you are using variable row heights based on content, with newly prepended rows to the data source, the row heights of a given row at a given index now longer matches what was previously calculated. We need an operation somehow to tell SfDataGrid that we've prepended X new rows to the data source so that it could properly shift the scroll position (to make it appear as if nothing had changed visually, except the ability to scroll up more) as well as shift internally cached information like row height.
There are some pub.dev flutter packages for lists that support infinite scrolling in both directions that can handle this use case. The SfDataGrid is very robust and it would open up a whole new series of use cases for the data grid if it was able to do this. Thank you for the consideration.

1 Reply

TP Tamilarasan Paranthaman Syncfusion Team January 19, 2023 12:17 PM UTC

Hi KD,

As of now, Flutter DataGrid does not have support for load more rows when scrolling in an upward direction. We have considered your request as a feature. We will implement this feature in any of our upcoming releases.

At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.  

Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.  

You can also communicate with us regarding the open features any time using our Feature Report page.   

Feedback link: https://www.syncfusion.com/feedback/40499/support-to-load-more-rows-when-scrolling-in-an-upward-direction

If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  



Live Chat Icon For mobile
Up arrow icon