1
Reply

How can I sum for conditional column

Shovan Saha

Shovan Saha

Apr 24 2017 9:58 AM
254
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)