for (int col = 0; col < dataGridView1.ColumnCount; col++)
if (dataGridView1.Columns[col].ToString() == string.Empty)
{
dataGridView1.Columns.RemoveAt(col);
}
}