Syncfusion.Grid.Windows


Syncfusion.Windows.Forms.Grid Namespace > GridModel Class > CalculatePreferredCellSize Method : CalculatePreferredCellSize(Graphics,Int32,Int32,GridStyleInfo,GridQueryBounds) Method
The System.Drawing.Graphics context of the canvas.
The row index.
The column index.
The GridStyleInfo object that holds cell information.
Vertical or horizontal.

CalculatePreferredCellSize(Graphics,Int32,Int32,GridStyleInfo,GridQueryBounds) Method

Calculates the preferred size of the cell based on its contents, including margins and any buttons.
Syntax
'Declaration
 
Public Overloads Function CalculatePreferredCellSize( _
   ByVal g As Graphics, _
   ByVal rowIndex As Integer, _
   ByVal colIndex As Integer, _
   ByVal style As GridStyleInfo, _
   ByVal queryBounds As GridQueryBounds _
) As Size
'Usage
 
Dim instance As GridModel
Dim g As Graphics
Dim rowIndex As Integer
Dim colIndex As Integer
Dim style As GridStyleInfo
Dim queryBounds As GridQueryBounds
Dim value As Size
 
value = instance.CalculatePreferredCellSize(g, rowIndex, colIndex, style, queryBounds)
public Size CalculatePreferredCellSize( 
   Graphics g,
   int rowIndex,
   int colIndex,
   GridStyleInfo style,
   GridQueryBounds queryBounds
)

Parameters

g
The System.Drawing.Graphics context of the canvas.
rowIndex
The row index.
colIndex
The column index.
style
The GridStyleInfo object that holds cell information.
queryBounds
Vertical or horizontal.

Return Value

The optimal size of the cell.
AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.26

See Also