Gustavo

Gustavo

  • NA
  • 1.3k
  • 455.2k

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

Apr 11 2010 5:27 PM

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)