Updating database from datagridview
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.
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.
Use content-based automatic resizing with caution when working with large amounts of data.
In this case, size adjustment occurs whenever cell contents change.
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.