Because Not Set restores the value inheritance, the Resizable property will never return a Not Set value unless the row or column has not been added to a Data Grid View control.

Set Resizable to Not Set to restore the inheritance.

Programmatic resizing is useful to avoid performance penalties with continuous resizing.

c cellvalidating cancel-65c cellvalidating cancel-9c cellvalidating cancel-44

The new sizes are automatically calculated to display all cell contents without clipping.

When automatic sizing is disabled, you can programmatically set the exact width or height of rows, columns, or headers through the following properties: These methods will resize rows, columns, or headers once rather than configuring them for continuous resizing.

Use content-based automatic resizing with caution when working with large amounts of data.

The value of this property is based on the column's Auto Size Mode property value unless that value is Not Set, in which case the control's Auto Size Columns Mode value is inherited.

With these values, you can limit which cells are used to calculate the preferred sizes.

The enumerations used by sizing properties and methods have similar values for content-based sizing.

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.

For example, if rows but not columns are configured for automatic sizing and Wrap Mode is enabled, users can drag column dividers to change the width of a column and row heights will automatically adjust so that cell contents are still fully displayed.

For maximum performance, use programmatic resizing instead so that you can resize at specific times, such as immediately after new data is loaded.