1
Answer

How can I sum for conditional column

Shovan Saha

Shovan Saha

7y
278
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)