You will typically call the programmatic resizing methods at specific times.
It is also useful to provide initial sizes for user-resizable rows, columns, and headers, and for column fill mode.
For example, if a column is hidden after it is automatically sized to fit a large cell value, the hidden column will not change its size if the row containing the large cell value is deleted.
Content-based automatic sizing modes do not affect rows, columns, or headers that you have hidden by setting the row or column Visible property or the control Row Headers Visible or Column Headers Visible properties to false.
If you configure both rows and columns for content-based automatic sizing and Wrap Mode is enabled, the Data Grid View control will adjust sizes whenever cell contents changed and will use an ideal cell height-to-width ratio when calculating new sizes.