I have datagridview and I want to insert in it values that come from textbox a and a NumericUpDown box but I face a problem which is that these values inserted into the datagridview are not in the column that I specified.
Here is the code I wrote:
dataGridView1.Rows.Add(MaterialTextBox.Text);
dataGridView1.Rows.Add(HoursNumericUpDown.Value);
dataGridView1.Rows.Add(MarkNumericUpDown.Value);
dataGridView1.Rows.Add(MarkPoints);
and by the way is that way of calculating the values that I get from NumericUpDown box is?
decimal MarkPoints, x, y;
x = HoursNumericUpDown.Value;
y = MarkNumericUpDown.Value;
MarkPoints = x * y;
Because when I write it with this way I got an error
decimal MarkPoints = HoursNumericUpDown.Value * HoursNumericUpDown.Value;
I think there is no different answer for example let's
HoursNumericUpDown value is 2
MarkNumericUpDown value is 3
the answer in the first way is 6 which is correct but the answer in the second way is 4. what is wrong?