Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. private void btnCalcular_Click(object sender, EventArgs e)
  2. {
  3. double total = 0;
  4.  
  5. foreach (DataGridViewRow row in dataGridView1.Rows)
  6. {
  7. double a = Convert.ToDouble(row.Cells[0].Value);
  8. double b = Convert.ToDouble(row.Cells[1].Value);
  9. row.Cells[2].Value = a - b;
  10. total += Convert.ToDouble(row.Cells[2].Value);
  11. }
  12. label1.Text = total.ToString();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement