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.

How to scroll the grid programatically

Thread ID:





5143 Jun 20,2003 11:10 AM Jun 20,2003 02:13 PM Windows Forms 2
Tags: GridControl
Roy Muller
Asked On June 20, 2003 11:10 AM

Hi! I am developing a touch-screen user interface and I have a need to scroll the grid with external button click events (Scroll +/-, Page +/-, Top/Bottom). Can anyone show me some calls to use to get Vertical scrolling to work with these external buttons? Must I use combinations of gridcontrol.ScrollCellIntoView() and gridcontrol.IsCellVisible(), or is there a more elegant solution? I have other controls that I scroll by maintaining a Scroll position value (Y offset from the top of the scrollable control). I scroll by adjusting the value and calling myScrollableControl.SetBounds(0, m_iScrollPosition, 0,0, BoundsSpecified.Y); Can I do something similar? Should I upload some code in a direct-trac support incident? Thanks for any help, -Roy

Administrator [Syncfusion]
Replied On June 20, 2003 12:10 PM

Tne simple way to scroll a grid 1 row at the time is to increment or decrement grid.TopRowIndex. If you want the current cell to be there as well, you can call grid.CurrentCell.MoveTo with the new top row index.

Roy Muller
Replied On June 20, 2003 02:13 PM

Thanks for the info, Clay. Let me give a little something back here; attached is a project that defines an interface for scrolling and has a few controls that implement it (one of them is the GridControl in a user control). It has some quirks, but should be informative to anyone else interested in scrolling without scrollbars. -Roy


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.

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.