RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2013-10-21T20:19:18Z
I have a search box for my users to select a row but the highlighted row is usually at the bottom of the grid.

I want to scroll the list so that the newly highlighted row is at the top of the grid. I know that I can set the VScrollBar.Value property to do this but I don't know what value to use.

The max value for VScrollBar is much larger than the number of rows in my grid. What is the relationship between a row and the VScrollBar.Value?

Thanks.

Ray
Igor/10Tec
2013-10-22T08:29:01Z
Our grid uses smooth pixel scrolling, and the Value properties of our scroll bar objects return the number of pixels the grid has been scrolled by. That's why VScrollBar.Value can be much greater than your row numbers.

If you know the height of every row in your grid, you could calculate the desired VScrollBar.Value, but there is a much better way - see the EnsureVisibleRow method.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2013-10-22T18:44:45Z
Thanks, Igor.

In my case I want not only the selected row to be visible but all the "children" of the row since my grid uses grouping. I am using the EnsureVisibleRow method which you suggested in conjunction with the RowChildCount property to ensure that the last child in the group is visible.