B
Brian Tkatch
DataGridView's RowEnter event has e.RowIndex as the current (new) row.
Yet CurrentCellAddress.Y is the old value.
This can be easily seen in a new form. Create a new windows
application, add a DataGridView, in the code add:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim table As New DataTable
table.Columns.Add()
table.Rows.Add(table.NewRow)
table.Rows.Add(table.NewRow)
DataGridView1.DataSource = table
End Sub
Private Sub DataGridView1_RowEnter(ByVal sender As Object, ByVal e
As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.RowEnter
MsgBox("RowEnter: " & e.RowIndex.ToString & vbCrLf _
& "CurrentCellAddress: " &
sender.CurrentCellAddress.Y.ToString)
End Sub
B.
Yet CurrentCellAddress.Y is the old value.
This can be easily seen in a new form. Create a new windows
application, add a DataGridView, in the code add:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim table As New DataTable
table.Columns.Add()
table.Rows.Add(table.NewRow)
table.Rows.Add(table.NewRow)
DataGridView1.DataSource = table
End Sub
Private Sub DataGridView1_RowEnter(ByVal sender As Object, ByVal e
As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.RowEnter
MsgBox("RowEnter: " & e.RowIndex.ToString & vbCrLf _
& "CurrentCellAddress: " &
sender.CurrentCellAddress.Y.ToString)
End Sub
B.