//Validating the Order column [Only numeric values allowed]
private void DataGrid1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
int newinteger;
if (e.ColumnIndex == 4)
{
bool Check = int.TryParse(e.FormattedValue.ToString(), out newinteger);
if (Check == false && e.FormattedValue.ToString() != "")
{
MessageBox.Show("Enter numeric value");
e.Cancel = true;
}
}
}
Tuesday, September 18, 2007
Subscribe to:
Post Comments (Atom)
2 comments:
Valare mosham
valare moshaM
Post a Comment