decimal zbroj = 0;
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
DataGridViewCell cell = row.Cells[5];
{
if (cell.Value != null && row.Cells[4].Value=="John Smith")
{
zbroj += Convert.ToDecimal(cell.Value);
}
}
}
tbIznosBrutoDodatkaOdbitka.Text = zbroj.ToString();
Updated the code..please check..