This documentation is archived and is not being maintained.

DataGridView.AutoResizeColumn Method

Adjusts the width of the specified column to fit the contents of its cells.

Name Description
DataGridView.AutoResizeColumn (Int32) Adjusts the width of the specified column to fit the contents of all its cells, including the header cell.
DataGridView.AutoResizeColumn (Int32, DataGridViewAutoSizeColumnMode) Adjusts the width of the specified column using the specified size mode.
DataGridView.AutoResizeColumn (Int32, DataGridViewAutoSizeColumnMode, Boolean) Adjusts the width of the specified column using the specified size mode, optionally calculating the width with the expectation that row heights will subsequently be adjusted.
Show: