VB.NET
DataGridTextBoxColumn colOrder = new DataGridTextBoxColumn();
colOrder.MappingName = "ORDER_NUMBER";
colOrder.HeaderText = "Work Order";
colOrder.Width = 75;
colOrder.ReadOnly = false;
colOrder.NullText = string.Empty;
colOrder.TextBox.Validating += new CancelEventHandler(Order_Validate);
dataGridTableStyle2.GridColumnStyles.Add(colOrder);.
.
.
C#
private void Order_Validate(Object sender, CancelEventArgs e)
{
TextBox txt = sender as TextBox;
if (!checkWorkOrder(txt.Text))
e.Cancel = true;
else
e.Cancel = false;
}
Answers
Know the answer? Post it. Somebody with the same question will find it here.