Here is my datagridview. I need the sum of AmountBDT where SuspenceAccount is Placid Express.
Sl | SuspenceAccount | AmountBDT |
1 | Placid Express | 30 |
2 | Prabhu Group | 40 |
3 | Placid Express | 20 |
4 | Ria Financial | 70 |
5 | Placid Express | 50 |
Sl | SuspenceAccount | AmountBDT |
1 | Placid Express | 30 |
2 | Prabhu Group | 40 |
3 | Placid Express | 20 |
4 | Ria Financial | 70 |
5 | Placid Express | 50 |
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rafnas T PPosted Apr 25, 2017, 12:14 AM
Shovan SahaPosted Apr 25, 2017, 12:19 PM
Yogendra BhardwajPosted Apr 24, 2017, 9:33 PM
foreach (DataGridViewRow row in dataGridView.Rows)
{
if(row.Cells[0].Value=='Placid Express')
sum += (int) row.Cells[2].Value;
}
MessageBox.Show("Sum of all the values is {0}", sum.ToString());