Datagridview CellLeave and CellValueChanged event

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top