2
Answers

How Do I: Make columns in a DataGridView the minimum size?

Gustavo

Gustavo

14y
2.6k
1

Hello:
 
I am populating a DataGridView and would like to make the columns the minimum size as long as the data can fit in them. I have tried the following line and it works:
dataGridViewReport_Process.Columns[0].AutoSizeMode =
DataGridViewAutoSizeColumnMode.Fill;
 
But: If I do it to the second column it will mess it up. Seems it will only allow me to do only one column.
 
Is there a way that I can have it do all the columns in the DataGridView?
 
Answers (2)