System.Windows.Forms.DataGridColumnStyle.GetPreferredHeight Method

When overridden in a derived class, gets the height used for automatically resizing columns.

Syntax

protected abstract int GetPreferredHeight (System.Drawing.Graphics g, object value)

Parameters

g
A System.Drawing.Graphics object.
value
An object value for which you want to know the screen height and width.

Returns

The height used for auto resizing a cell.

Remarks

The DataGridColumnStyle.GetPreferredSize(System.Drawing.Graphics, object) will usually be invoked from a mouse down event to resize a column's height for a long string.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0