for (i = 0; i < dataGridView1.Rows.Count; i++) { if (dataGridView1.Rows[i].Cells[5].Value.ToString() == comboBox2.Text) { dataGridView1.Rows[i].