I have a DataGridView control and I want to know if the user has changed any data in the row when they leave one row and go to another row. Here's what I've done...
In the Form Class I defined a Before and After row image as follows:
Dim rwBefRow As New DataGridViewRow 'Before row image
Dim rwAftRow As New DataGridViewRow 'After row image
Then in the DataGridView_RowEnter event I copied the row to rwBefRow before the user gets control as follows:
rwBefRow = CType(dgvPhysCME.Rows(e.RowIndex), DataGridViewRow)
In the DataGridView_RowLeave event, I copied the row to rwAftRow after the user makes any changes as follows:
rwAftRow = CType(dgvPhysCME.Rows(e.RowIndex), DataGridViewRow)
At this point, when I look at rwBefRow, it contains the data in the row AFTER I make them. It's like when the RowLeave event fires, it also fires the RowEnter. I put a breakpoint at the RowEnter event and it gets control only when a row is entered, as you would expect.
What can I do to keep the rwBefRow values unchanged when I get to the RowLeave event?
Any help would be appreciated. Eddie