- g
- A System.Drawing.Graphics that draws the cell.
- value
- The value that must fit in the cell.
A System.Drawing.Size that contains the drawing information for the cell.
The DataGridBoolColumn.GetPreferredSize(System.Drawing.Graphics, object) method allows you to resize the column based on the value displayed. For example, if a cell contains an especially large value, you can use the DataGridBoolColumn.GetPreferredSize(System.Drawing.Graphics, object) method to return the optimum size of the cell based on the value. The optimum size takes into account not only the size of the string, but also the font used to display it.