Programmatic resizing is useful to avoid performance penalties with continuous resizing. When you programmatically resize columns that have Inherited Auto Size Mode property values of Fill, however, the calculated content-based widths are used to proportionally adjust the column Fill Weight property values, and the actually column widths are then calculated according to these new proportions so that all columns fill the available display area of the control.
There are two kinds of automatic sizing in the Data Grid View control: column fill mode and content-based automatic sizing.
Programmatic content-based resizing affects rows, columns, and headers regardless of their visibility.
Automatic sizing does not occur when visibility changes, so changing the column Visible property back to true will not force it to recalculate its size based on its current contents.
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.