Answer the question
In order to leave comments, you need to log in
How to remove all empty columns in dataGridView1 c#?
Can you please tell me how to remove all empty columns in dataGridView1?
Here I wrote the code. Tell me what's wrong?
for (int col = 0; col < dataGridView1.ColumnCount; col++)
if (dataGridView1.Columns[col].ToString() == string.Empty)
{
dataGridView1.Columns.RemoveAt(col);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question