Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. decimal totalSelected = 0;
  2. dataGridView1.Focus();
  3.  
  4. foreach (DataGridViewRow row in dataGridView1.Rows)
  5. {
  6. DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell;
  7.  
  8. if (cell.Value != null)
  9. {
  10. if (cell.Value == cell.TrueValue)
  11. {
  12. totalSelected += Convert.ToDecimal(row.Cells[3].Value);
  13. }
  14. }
  15. }
  16. lblTotalToPaid.Text = totalSelected.ToString("$0.00", CultureInfo.CurrentCulture);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement