Version

GetPreferredWidth Method

Calculates the ideal width of the column based on the specified criteria.
Syntax
'Declaration
 
Public Overrides Function GetPreferredWidth( _
   ByVal autoSizeColumnMode As DataGridViewAutoSizeColumnMode, _
   ByVal fixedHeight As Boolean _
) As Integer
public override int GetPreferredWidth( 
   DataGridViewAutoSizeColumnMode autoSizeColumnMode,
   bool fixedHeight
)

Parameters

autoSizeColumnMode
A value that specifies an automatic sizing mode.
fixedHeight
true to calculate the width of the column based on the current row heights; false to calculate the width with the expectation that the row heights will be adjusted.

Return Value

The ideal width of the column in pixels.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also