Hi
Change your code like this.Change first row and then colum dataGridView1[2,i].Value should be as dataGridView1[i,2].Value.
foreach (DataGridViewRow row in dataGridView1.Rows)
{
dataGridView1[i,2].Value = (row.Cells[2].Value.ToString().ToLower()).Replace(textBox6.Text.ToLower(), textBox7.Text);
i++;
dataGridView1.Refresh();
}