private void saleslist_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 4) total.Text = CellSum().ToString(); } private double CellSum() { double sum = 0; for (int i = 0; i < saleslist.Rows.Count; ++i) { double d = 0; Double.TryParse(saleslist.Rows[i].Cells[4].Value.ToString(), out d); sum += d; } return sum; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)