for (int j = 0; j <= dataGridView1.RowCount - 1; j++)
{
if (!dataGridView1.Rows[j].IsNewRow)
{
if (dataGridView1.Rows[j].Cells[10].Value == null)
{
MessageBox.Show("Please fill in : Input Unit Num in Row ", "Result", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
//if (//ต้องเชคยังไงครับ)
//{
// MessageBox.Show("Please fill in : Input Number Not A-Z /@*-+ in Row ", "Result", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// return;
//}
}
}
object test = dataGridView1.Rows[j].Cells[10].Value;
if(test.GetType()==typeof(string))
{
MessageBox.Show("Please fill in : Input Number Not A-Z /@*-+ in Row ", "Result", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int n;
for (int j = 0; j <= dataGridView1.RowCount - 1; j++)
{
if (!dataGridView1.Rows[j].IsNewRow)
{
if (!int.TryParse(dataGridView1.Rows[j].Cells[10].Value.ToString(), out n))
{
MessageBox.Show("Please fill in : Input Unit Num in Row ", "Result", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
}