Rowvalidated rowvalidating

If content-based automatic sizing is enabled for one dimension only—that is, for rows but not columns, or for columns but not rows—and Wrap Mode is also enabled, size adjustment also occurs whenever the other dimension changes.

In this case, call the Update Cell Value method to force the control to update the cell display and apply the current automatic sizing modes.

rowvalidated rowvalidating-74

There are two kinds of automatic sizing in the Data Grid View control: column fill mode and content-based automatic sizing.

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.

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.