Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net DataGridView scrolling error

Hi
I am using the code below to scroll four DataGridViews when my first DataGridView is scrolled. When I play around with it and click in the first DataGridView I get the error
"Specified argument was out of the range of valid values. Parameter name value"

      Try

            Me.DataGridView1.FirstDisplayedScrollingRowIndex = Me.DataGridView5.FirstDisplayedScrollingRowIndex
            Me.DataGridView1.HorizontalScrollingOffset = Me.DataGridView5.HorizontalScrollingOffset

            Me.DataGridView2.FirstDisplayedScrollingRowIndex = Me.DataGridView5.FirstDisplayedScrollingRowIndex
            Me.DataGridView2.HorizontalScrollingOffset = Me.DataGridView5.HorizontalScrollingOffset

            Me.DataGridView3.FirstDisplayedScrollingRowIndex = Me.DataGridView5.FirstDisplayedScrollingRowIndex
            Me.DataGridView3.HorizontalScrollingOffset = Me.DataGridView5.HorizontalScrollingOffset

            Me.DataGridView4.FirstDisplayedScrollingRowIndex = Me.DataGridView5.FirstDisplayedScrollingRowIndex
            Me.DataGridView4.HorizontalScrollingOffset = Me.DataGridView5.HorizontalScrollingOffset

        Catch ex As Exception
            MsgBox("Scrolling error " & ex.Message)
        End Try
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

And where do you have that code?
Avatar of Murray Brown

ASKER

Private Sub DataGridView1_Scroll(sender As Object, e As System.Windows.Forms.ScrollEventArgs) Handles DataGridView1.Scroll

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks