Linking the scrollbars of two grid controls

I have two grid controls in a form and I want to link the scrollbars so that the scrollbar on the second is hidden and the scrollbar on the first controls both. I looked at the ScrollBars sample under QuickStart and tried to pattern my code after the code for using a detached scrollbar. Basically, gridControl1 has the vscrollbehavior set to automatic and gridControl2 has it set to shared. Then I tried to set: gridControl2.VScrollBar.InnerScrollBar = gridControl1.VScrollBar.InnerScrollBar; This does not do the trick. Is there a way to do what I want? I appreciate your help, Cathy

1 Reply

AD Administrator Syncfusion Team October 28, 2003 09:47 PM UTC

Hook the detached scrollbar to one of your grids, and hide the scrollbars on the other. Handle the TopRowChanged event for the scrollbar grid, and in your handler, set the other grid's TopRowIndex to be the same as the scrollbar grid's TopRowIndex. This will make the single scrollbar 'drive' both grids.

Loader.
Up arrow icon