How can I determine if grid is scrolled to the end (thumb is at the bottom of a scroll bar)?
Hi adogg
I've always found you need to use a combination of the Grid.ActiveRowScrollRegion to get the ScrollPosition and the ActiveRowScrollRegion.VisibleRows.Count to deteremine if we are scrolled to the bottom of a grid. You also need to know the number of rows of data that you have available to display.
The scroll position tells you which row of the grid is the top most visible at the present time and the visible rows is the number you can see on the screen.
So, if ScrollPosition + VisibleRows.Count > DataSet.Rows.Count then the last row is visible.
Hope that helps
Alan
Alan, I've tested you method and it's also not very accurate - when grid is scrolled to the bottom I always get ScrollPosition + VisibleRows.Count = DataSet.Rows.Count and it's the equal even if scroll is "one click before" it's maximum value. So, it doesn't work for me.
So, I got another question is there anyway to get vertical scrollbar Maximum value?
I think you can check if the scrollregion rect height equals to the scrollregion.ScrollPosition. Didn't try it yet.