Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnCalcular_Click(object sender, EventArgs e)
- {
- double total = 0;
- foreach (DataGridViewRow row in dataGridView1.Rows)
- {
- double a = Convert.ToDouble(row.Cells[0].Value);
- double b = Convert.ToDouble(row.Cells[1].Value);
- row.Cells[2].Value = a - b;
- total += Convert.ToDouble(row.Cells[2].Value);
- }
- label1.Text = total.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement