
Bug?... with Datagrid RowColChange Event
I have been experimenting with the Datagrid control and I fail to understand
the logic used by VB in passing the parameter values to the routine:
Private Sub dgdProd_RowColChange(LastRow As Variant, ByVal LastCol As
Integer)
The following debug trace will, hopefully, expose the problem:
RowColChange From 9, -1 To >>> 0, 0
RowColChange From , 0 To >>> 0, 1
RowColChange From 1, 1 To >>> 1, 1
RowColChange From , 1 To >>> 1, 2
RowColChange From 2, 2 To >>> 3, 1
RowColChange From 4, 1 To >>> 4, 1
RowColChange From 5, 1 To >>> 7, 2
RowColChange From 8, 2 To >>> 0, 0
RowColChange From , 0 To >>> 0, 1
RowColChange From 1, 1 To >>> 2, 0
RowColChange From , 0 To >>> 2, 1
RowColChange From , 1 To >>> 2, 2
RowColChange From , 2 To >>> 2, 3
RowColChange From 3, 3 To >>> 3, 3
RowColChange From 4, 3 To >>> 4, 3
RowColChange From 5, 3 To >>> 5, 3
RowColChange From 6, 3 To >>> 6, 2
The above trace was obtained by clicking randomly on grid cells and printing
as per below:
Private Sub dgdProd_RowColChange(LastRow As Variant, ByVal LastCol As
Integer)
Debug.Print "RowColChange From " & LastRow & ", " & LastCol & " To >>> "
& dgdProd.Row & ", " & dgdProd.Col
End Sub
I was expecting the FROM figures to always equal the TO figures from the
line immediately above.
Am I missing something????
Can somebody please advise?
Thanks in advance,
Chris.