for (int i = 1; i < dataGridView1.RowCount - 1; i++)
{
Boolean isEmpty = true;
for(int j=0;j<dataGridView1.Columns.Count; j++)
{
if (dataGridView1.Rows[i].Cells[j].Value.ToString() != "" )
{
isEmpty = false;
break;
}
}
if (isEmpty)
{
dataGridView1.Rows.RemoveAt(i);
i--;
}
}