Spread Windows Forms 6.0 Product Documentation
GetPreferredHeight Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > Row Class : GetPreferredHeight Method


Glossary Item Box

Gets the minimum height necessary to display the text in all cells in this row.

Syntax

Visual Basic (Declaration) 
Public Function GetPreferredHeight() As Single
Visual Basic (Usage)Copy Code
Dim instance As Row
Dim value As Single
 
value = instance.GetPreferredHeight()
C# 
public float GetPreferredHeight()

Return Value

Single-precision, floating-point number of pixels in height

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.

C#Copy Code
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;
Visual BasicCopy Code
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

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

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.