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 scroll the grid programatically

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

2 Replies

AD Administrator Syncfusion Team June 20, 2003 04:10 PM UTC

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.

RM Roy Muller June 20, 2003 06:13 PM UTC

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

Live Chat Icon For mobile
Up arrow icon