private void dgErrorLimits_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { var itemID = e.Control as TextBox; if (dgErrorLimits.CurrentCell.ColumnIndex == 1 && itemID != null) //Where the ColumnIndex of your "itemID" { itemID.KeyPress += itemID_KeyPress; } }