Hi
can you please try the below code. I couldn't check here.
int bedSum = 0;
int blanketSum = 0;
for (int i = 0; i < dataGridView1.Rows.Count; ++i)
{
switch (dataGridView1.Rows[i].Cells["ITEM NAME"].ToString())
{
case "BEDS":
bedSum += Convert.ToInt32(dataGridView1.Rows[i].Cells["ITEM QUANTITY"].Value);
break;
case "BLANKET":
blanketSum += Convert.ToInt32(dataGridView1.Rows[i].Cells["ITEM QUANTITY"].Value);
}
}