Shovan Saha

Shovan Saha

  • NA
  • 321
  • 86.9k

How can I sum for conditional column

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