Returns the size of the cell contents.
| C# | void object.CalcOptimalCell(int ItemIndex, short ColIndex, int AvailableWidth, out int WidthPix, out int HeightPix); |
| VB.NET | object.CalcOptimalCell(ByVal ItemIndex As Integer, ByVal ColIndex As Short, ByVal AvailableWidth As Integer, ByRef WidthPix As Integer, ByRef HeightPix As Integer) |
| C++ | HRESULT object->CalcOptimalCell(long ItemIndex, short ColIndex, int AvailableWidth, int* WidthPix, int* HeightPix); |
| C | HRESULT object->raw_CalcOptimalCell(long ItemIndex, short ColIndex, int AvailableWidth, int* WidthPix, int* HeightPix); |
| VB | object.CalcOptimalCell(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AvailableWidth As Integer, WidthPix As Integer, HeightPix As Integer) |
object
A SftTreeItems object.
ItemIndex
The zero-based index of the item.
ColIndex
The zero-based column number of the cell whose optimal width is to be calculated.
AvailableWidth
The width available to display the cell contents or 0 to calculate the optimal width and height without any constraints in width.
WidthPix
Returns the optimal width of the cell, in pixels.
HeightPix
Returns the optimal height of the cell, in pixels.
The CalcOptimalCell method returns the size of the cell contents.
This method can be used to calculate the best width and height for a cell.
The Column.OptimalWidth property can be used to calculate a column's optimal width. The Column.MakeOptimal method can be used to set a column's optimal width without having to calculate it first.
See Also SftTreeItems Object | Object Hierarchy