DataGridView settings

joe_pool_is

Well-known member
Joined
Jan 18, 2004
Messages
451
Location
Texas
Ive got a DataGridView (DGV) on a form that can display a *lot* of information - about 15 columns and thousands of rows. The rows arent a problem, but it is difficult to display all of the columns because the Default cell size is larger than necessary.

Once the data is loaded, double-clicking a header-bar between cells will resize a column to the best fit, but not all of our users know this. Is there a way to get a DGV to autosize each column programatically?

Also, my fonts are all set to 8.25pt, but the cells are all still large. How do I make them smaller?

Finally, the default first column on the DGV is a row selector. Is there a way to adjust the width of this column? It doesnt really need to be as big as the default.

IDE: VS2005
 
Re: DataGridView settings [resolved]

Nevermind. I found it.

On the DataGridView control, I set the RowHeaderVisible property to False, the SelectionMode behavior to FullRowSelect, and the Layouts AutoSizeColumnMode and AutoSizeRowsMode to AllCells.
 
Back
Top