ArtA
  • ArtA
  • Newbie Topic Starter
2016-01-09T17:11:36Z
I have two grids which I display side by side. Both grids contain the same number of rows. I want the scrolling of the grids to be synched - when I scroll one grid, the other scrolls as well so that the top rows of both grids is always the same index.

I have looked at the scrollbar properties/events and don't see a way to do this but I am new to the control. Is there a way to do this with the control? If not, can I do so with API calls? I have API code that does this with two listviews via subclassing but will it work for the grid control as well?
ArtA
  • ArtA
  • Newbie Topic Starter
2016-01-11T00:36:21Z
I found that I can do this using the ScrollBarPositionChanged event in each grid with code like this:

Private Sub Grid1_ScrollBarPosChanged(ByVal eBar As iGrid600_10Tec.EScrollBar, ByVal lValue As Long)
    If lValue = Grid2.VScrollBar.value Then
        Exit Sub
    Else
        Grid2.VScrollBar.value = lValue
    End If
End Sub

Private Sub Grid2_ScrollBarPosChanged(ByVal eBar As iGrid600_10Tec.EScrollBar, ByVal lValue As Long)
    If lValue = Grid1.VScrollBar.value Then
        Exit Sub
    Else
        Grid1.VScrollBar.value = lValue
    End If
End Sub