I am trying to compare a row in a DataGridView before the user gets focus to the row after the user loses focus. I'm doing this to see if anything in the row was changed.
Here's how I am trying to do this:
(Note:
dgvPhysCME
is the name of the DataGridView control.)
In the Form Class, I have the following temporary rows defined...
Dim rwBefRow As New DataGridViewRow
Dim rwAftRow As New DataGridViewRow
Then in the
RowEnter
event, I have...
rwBefRow = CType(dgvPhysCME.Rows(e.RowIndex), DataGridViewRow)
Then in the
RowLeave
event, I have...
rwAftRow = CType(dgvPhysCME.Rows(e.RowIndex), DataGridViewRow)
When I run this in debug, I can list the "before" values in the
RowEnter
event just fine. However, once I get into the
RowLeave
event the "before" values in
rwBefRow
have been updated to the "current" values so all the values in the
rwBefRow
are the same as the
rwAftRow
.
What am I doing wrong?
Thanks, Eddie