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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

15739 Jun 25,2004 03:04 PM UTC Jun 25,2004 06:08 PM UTC Windows Forms 2
loading
Tags: GridControl
Dan
Asked On June 25, 2004 03:04 PM UTC

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?

Administrator [Syncfusion]
Replied On 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.

Dan
Replied On 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!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;