If you want to validate data entry while still editing a cell you will need to set up a key press handler each time you begin editing a cell you need to validate.
To do that you must handle the DataGridview.EditingControlShowing event, and within that you will attach the keypress handler.
private void dataGridView1_EditingControlShowing(object sender,
DataGridViewEditingControlShowingEventArgs e)
{
dataGridView1.EditingControl.KeyPress -= new KeyPressEventHandler(MyKeyPressHandler);
dataGridView1.EditingControl.KeyPress += new KeyPressEventHandler(MyKeyPressHandler);
}
By checking the arguments to the EditingControlShowing handler you can be selective about the cells you decide to validate, or use different key press handlers for each cell.
Note that the key press handler is removed before it is added. This is to prevent a build up of identical handlers when you keep entering a cell. Removing a handler which doesn't exist (on first entry) isn't a problem.