Updating database using datagridview c
Note: If you maintain cell values in a custom data cache using virtual mode, automatic sizing occurs when the user edits a cell value but does not occur when you alter a cached value outside of a Cell Value Pushed event handler.
In this case, size adjustment occurs whenever cell contents change.
For example, you might programmatically resize all columns immediately after loading data, or you might programmatically resize a specific row after a particular cell value has been modified. Get Preferred Width() methods or by calling protected resizing method overloads in a derived Data Grid View control.
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.
You can also configure rows, columns, and headers to automatically adjust their sizes to fit their cell contents.
For more information about this mode, see the Column Fill Mode section below.