1
Answer

How can I sum for conditional column

Photo of Shovan Saha

Shovan Saha

8y
887
1
var sumObject = dataGridView1.Rows.Cast<DataGridViewRow>()
.Sum(row => row.Cells["AmountBDT"].Value.ToString(), "SuspenceAccount = Placid Express");
 
Here two column : AmountBDT & SuspenceAccount. Placid Express is one of the item of SuspenceAccount.

Answers (1)