DataGridView.AutoResizeColumns Method
.NET Framework 2.0
Adjusts the width of all columns to fit the contents of their cells.
DataGridView Members
System.Windows.Forms Namespace
| Name | Description |
|---|---|
| DataGridView.AutoResizeColumns () | Adjusts the width of all columns to fit the contents of all their cells, including the header cells. |
| DataGridView.AutoResizeColumns (DataGridViewAutoSizeColumnsMode) | Adjusts the width of all columns using the specified size mode. |
| DataGridView.AutoResizeColumns (DataGridViewAutoSizeColumnsMode, Boolean) | Adjusts the width of all columns using the specified size mode, optionally calculating the widths with the expectation that row heights will subsequently be adjusted. |
Reference
DataGridView ClassDataGridView Members
System.Windows.Forms Namespace