I would like to programatically scroll my GDBG to a certain row in the grid, making that row the first visible one at the top.
I think I''m *almost* there, with this (targetRow comes from looking through my bound DataView):
firstRow = grid1.Binder.ListManagerPositionToRowIndex(targetRow);
Then I call this (is MoveTo() the best way to do this?)...
grid1.CurrentCell.MoveTo(firstRow,2, GRID.GridSetCurrentCellOptions.ForceRefresh | GRID.GridSetCurrentCellOptions.ScrollInView );
...but it seems to scroll the grid so that this cell is barely visible at the bottom of the grid.
So what''s the best way to get this to the top?
Any way to get this to the top?
ADAdministrator Syncfusion Team June 25, 2004 10:27 AM
Try using grid.ScrollCellInView to see if that does what you need.
You can also explicitly set this.grid.TopRowIndex to specify what you want as the top row.
DADanJune 25, 2004 01:08 PM
TopRowIndex ended up being what I needed. The help seems a little "off" on this one, says:
"Gets or sets the column index of the left column. Scrolls the grid when changed."
They ScrollCellInView seems to do the same thing, and I guess have the additional feature that you can get horizontal scrolling involved if the cell is way off the view to the right.