I have a NumericUpDown
box and depending on its value, I want to insert the letter into a DataGridView
. Here is my code, but it does not insert into the column I want.
if (MarkNumericUpDown.Value < 50)
{
//dataGridView1.Rows.Add("F");
}
else if (MarkNumericUpDown.Value > 50 && MarkNumericUpDown.Value <= 64)
{
//dataGridView1.Rows.Add("D");
}
else if (MarkNumericUpDown.Value > 64 && MarkNumericUpDown.Value <= 68)
{
//dataGridView1.Rows.Add("D+");
}
else if (MarkNumericUpDown.Value > 68 && MarkNumericUpDown.Value <= 72)
{
//dataGridView1.Rows.Add("C-");
}
else if (MarkNumericUpDown.Value > 72 && MarkNumericUpDown.Value <= 76)
{
//dataGridView1.Rows.Add("C");
}
else if (MarkNumericUpDown.Value > 76 && MarkNumericUpDown.Value <= 80)
{
//dataGridView1.Rows.Add("C+");
}
else if (MarkNumericUpDown.Value > 80 && MarkNumericUpDown.Value <= 84)
{
//dataGridView1.Rows.Add("B-");
}
else if (MarkNumericUpDown.Value > 88 && MarkNumericUpDown.Value <= 92)
{
//dataGridView1.Rows.Add("B");
}
else if (MarkNumericUpDown.Value > 92 && MarkNumericUpDown.Value <= 96)
{
//dataGridView1.Rows.Add("B+");
}
else if (MarkNumericUpDown.Value > 96 && MarkNumericUpDown.Value <= 100)
{
//dataGridView1.Rows.Add("A-");
}