Cell validating cancel

Private Sub Datagrid1_Cell Validating(By Val sender As Object, By Val e As System.

You can use data validation to restrict the type of data or values that users enter into cells. Data Property Name = "Cell_2") Then If CBool(Datagrid1("Cell_1", e. I wrote code in the cellvalidating event as follows. Data Grid View Cell Validating Eve nt Args) Handles Datagrid1. Its not permissible to have the two selected to true, but they can both be false. I'm using a Data Grid View in my Win Forms application. Process Dialog Key(key Data) End Function No, but you can manually fire the Cell Validating event. All events are is a class using the Observer Pattern, they're no different than any other method.My main objective is to make the Enter key not move to the next row in the grid. If that doesn't work, you can create a Key Press event on the cell and emulate pressing Enter on the cell, but that may mess with the users UI, just put the carat back where it was.