I using this code for validation integer input on datagridview.
private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
if (string.IsNullOrEmpty(e.FormattedValue.ToString()))
{
MessageBox.Show("Cannot Empty!");
e.Cancel = true;
}
else if (...)
{
MessageBox.Show("Only can input number!");
e.Cancel = true;
}
}
and now I have trouble on the code that I put a dots. is there any that can give you an idea ? whether the use regex can be used in these conditions ?