We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to make a given GDBG row at the top of the viewable grid

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?

2 Replies

AD Administrator Syncfusion Team June 25, 2004 03:27 PM UTC

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.

DA Dan June 25, 2004 06:08 PM UTC

Thanks Clay! 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." column index? 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. Thanks again!

Live Chat Icon For mobile
Up arrow icon