Datagridview CellLeave and CellValueChanged event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to check the value in a cell after user tab to next cell or
having the cell value changed.
I use CellLeave event and CellValueChanged event and then check
for the value.
If the value is not a valid one, then I decide to prompt user, make it stay
on the
cell and then let user to edit by using the code inside the event:

MsgBox("Value not correct, please check")
With mydatagridview
.ClearSelection()
.CurrentCell = dgvTS.Rows(e.RowIndex).Cells("check_column")
.BeginEdit(True)
End With

But it does not work for my code part within the With ... End With,
it still tab to the next cell.
What should I do?
 
Back
Top