You can make use of cellEndEdit event of datagridview.
Just add one evnet handler:
dataGridView1.CellEndEdit
+= new DataGridViewCellEventHandler(dataGridView1_CellEndEdit);
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
int row = dataGridView1.CurrentCell.RowIndex;
int column = dataGridView1.CurrentCell.ColumnIndex;
string item = dataGridView1[column, row].Value.ToString();
// Here you can put extra condition to check item is valid or not.
if (item.Length < 10)
{
MessageBox.Show("The number is too short, it has to be 10 characters long.\nPlease repair the entry...", "Too short number");
bShowing = true;
dataGridView1.BeginEdit(true);
}
}