I want to perform addition of the total cell. however, it is giving value of latest cell added. Attached the screenshot of gridview:
private void dataGridView1_CellValueChanged_1(object sender, DataGridViewCellEventArgs e) {
if (dataGridView1["Total", e.RowIndex].Value != null) {
for (int i =0; i < dataGridView1.Rows.Count; i++) { double grandtotal = Convert.ToDouble(dataGridView1["Total", e.RowIndex].Value); txtboxGrandTotal.Text = grandtotal.ToString(); } }
}