Spread Windows Forms 12.0 Product Documentation
GetPreferredHeight Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > Row Class : GetPreferredHeight Method
Gets the minimum height necessary to display the text in all cells in this row.
Syntax
'Declaration
 
Public Function GetPreferredHeight() As Single
'Usage
 
Dim instance As Row
Dim value As Single
 
value = instance.GetPreferredHeight()
public float GetPreferredHeight()

Return Value

Remarks
Row heights can be based on the data in the cells using this method or SheetView.GetPreferredRowHeight method. For more information, see Resizing the Row and Column to Fit the Data.
Example

This example determines the height of the row based on the text in the first cell.

FarPoint.Win.Spread.Row row;
float size;
row = fpSpread1.ActiveSheet.Rows[0];
fpSpread1.ActiveSheet.Cells[0, 0].Text = "This text will be used to determine the height of the row.";
size = row.GetPreferredHeight();
row.Height = size;
Dim row As FarPoint.Win.Spread.Row
Dim size As Single
row = FpSpread1.ActiveSheet.Rows(0)
FpSpread1.ActiveSheet.Cells(0, 0).Text = "This text will be used to determine the height of the row."
size = row.GetPreferredHeight()
row.Height = size
See Also

Reference

Row Class
Row Members
GetPreferredRowHeight Method

User-Task Documentation

Resizing the Row or Column to Fit the Data