Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
Grid scroll
posted

Hi, I have a grid binded to ultraDataSource. I notice that the vertical scroll position always goes back to zero whenever the data in the grid is updated even though I've already scrolled down. How can I avoid this? I want the scrollbar to stay where it was.  Thank you.

Parents
No Data
Reply
  • 37774
    Verified Answer
    posted

    How are you updating your data?  If you're completely rebinding the grid (i.e. setting the DataSource property), or doing something that causes the grid to get a Reset notification, then the grid will blow away its existing rows and recreate them, so you will lose your current scroll position.  Another possibility is that your DataSource is resetting the current position that is maintained by the CurrencyManager, so the grid is respecting that.  A solution to the first issue would be to maintain the position of the current row yourself and re-set it after you've updated the data.  A way of determining if the second issue is your problem would be to set the SyncWithCurrencyManager property to False.

    -Matt

Children