Documentation for this section has not yet been entered.
This property lets you configure the control so that column widths are automatically adjusted either to fill the control or to fit cell contents. Size adjustments occur in fill mode whenever the width of the control changes. In content-based sizing modes, size adjustments occur whenever cell contents change or, if DataGridViewCellStyle.WrapMode is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance.
To change the sizing mode for an individual column, set its DataGridViewColumn.AutoSizeMode property. The default value of this property is DataGridViewAutoSizeColumnMode.NotSet, indicating that the column inherits its behavior and its DataGridViewColumn.InheritedAutoSizeMode property value from the control.
Columns in fill mode divide the available control width in proportions indicated by their DataGridViewColumn.FillWeight property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined DataGridViewColumn.MinimumWidth values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see Column Fill Mode in the Windows Forms DataGridView Control.
Only columns with a DataGridViewColumn.Visible property value of true are resized automatically, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse.
To adjust column widths programmatically, use the erload:System.Windows.Forms.DataGridView.AutoResizeColumn or erload:System.Windows.Forms.DataGridView.AutoResizeColumns methods or set the column DataGridViewColumn.Width property.
For more information about content-based automatic sizing, see Sizing Options in the Windows Forms DataGridView Control.