is there any way to track the scrollbar's position?
I want to be able to return to a certain spot automatically after processing some data.
Hi,
I don't think there is any numeric scrollbar position exposed. Even if it were, you would still have the same issue about rows being deleted, since that would change the overall scroll range, right? This also means that your method of storing the active row index may not be valid, either, since the indicies of the rows might change if rows are added or removed.
What I typically recommend is that you store some kind of key information for the ActiveRow and also the FirstRow. The FirstRow is accessed on the ActiveRowScrollRegion like so:
this.ultraGrid1.ActiveRowScrollRegion.FirstRow
Then you can loop through the grid and find these two rows and set them back as the FirstRow and ActiveRow - assuming they still exist.
MyGrid.ActiveRowScrollRegion.FirstRow.Index
I wanted to clarify because I dont think I was very clear. I am re-binding my data to the grid and I want to jump to the same (or as similar as possible) position before my rebind. I can grab the active row index before I unload my data and then reset the active row to that index afterwards.
However,
1) that doesn't bring the scrollbar to the same spot as it was before a datareload, it just brings the row into view near the bottom of the grid.
2) if that active row was deleted, I think this causes issues because that row isn't there anymore.
What I'm looking for is a scrollbar position, independant of the rows if possible.