You can customize sizing behaviors when working with derived Data Grid View cell, row, and column types by overriding the Data Grid View Cell. The protected resizing method overloads are designed to work in pairs to achieve an ideal cell height-to-width ratio, avoiding overly wide or tall cells.
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. If the State value includes the Resizable Set flag, the Resizable property value is not inherited. If you need to determine whether the Resizable property value of a row or column is inherited, examine its State property. 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.