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
1210
Get a the win grid scroll bar positoin
posted

Hi all,

I have a grid showing data and being refreshed periodically.

I want to save the scroll bar position before the refresh and be able to restore it after the refresh.

How do i get/set the scroll bar position by code?

Maybe i can set the scroll region by row numbers (row objects won't work since the entire grid is re-binded with new data...)

 

Thanx!!!

-Gili

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Gili,

    If the grid is being bound with new data, then the scroll position probably won't be valid any more, anyway, will it? There might be a different number of rows after the refresh? Or the expanded states of the rows may change.

    If you are going to have the same number of rows, then what I would do is store the ActiveRowScrollRegion.FirstRow.Index. Then you can simply set the FirstRow to the row at that same index after the refresh.

    Of, if there is some key value in the row that will not change, you could use that instead of the index. There's no search functionlality built-in to the grid, though, so you would have to loop to find the new row with the same key after you refresh.

Children
No Data