Xceed Grid for WinForms v4.3 Documentation
GetFittedWidth Method (CellEditorManager)


Xceed.Grid.v4.3 Assembly > Xceed.Grid.Editors Namespace > CellEditorManager Class : GetFittedWidth Method
The System.Windows.Forms.Control that will be used to edit the content of the cell. Can be a null reference (Nothing in Visual Basic) if the editor is not displayed.
The Xceed.Grid.Cell whose content is to be edited by the control.
This parameter is reserved for future use.
Gets the System.Drawing.Graphics object used to paint.
true if the editor is being printed; false otherwise.
Retrieves a value representing the fitted width of the editor in pixels and raises the QueryFittedWidth event.Retrieves a value representing the fitted width of the cell editor in pixels.
Syntax
'Declaration
 
Protected Friend Function GetFittedWidth( _

   ByVal control As Control, _

   ByVal cell As Cell, _

   ByVal mode As AutoWidthMode, _

   ByVal graphics As Graphics, _

   ByVal printing As Boolean _

) As Integer
'Usage
 
Dim instance As CellEditorManager

Dim control As Control

Dim cell As Cell

Dim mode As AutoWidthMode

Dim graphics As Graphics

Dim printing As Boolean

Dim value As Integer

 

value = instance.GetFittedWidth(control, cell, mode, graphics, printing)
protected internal int GetFittedWidth( 

   Control control,

   Cell cell,

   AutoWidthMode mode,

   Graphics graphics,

   bool printing

)

Parameters

control
The System.Windows.Forms.Control that will be used to edit the content of the cell. Can be a null reference (Nothing in Visual Basic) if the editor is not displayed.
cell
The Xceed.Grid.Cell whose content is to be edited by the control.
mode
This parameter is reserved for future use.
graphics
Gets the System.Drawing.Graphics object used to paint.
printing
true if the editor is being printed; false otherwise.

Return Value

A value representing the fitted width of the cell editor in pixels. If -1, then no fitted width is required or desired.A value representing the fitted width of the cell editor in pixels.
Remarks

The GetFittedWidth method must be called outside of the calls to BeginInit and Xceed.Grid.GridControl.EndInit methods because the data is not loaded into the grid until EndInit is called therefore, the fitted width cannot be calculated until that moment.

Requirements

Target Platforms: 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

Reference

CellEditorManager Class
CellEditorManager Members