Click or drag to resize

IWorksheet GetRowHeightPixels Method

Returns height from RowRecord if there is a corresponding RowRecord. Otherwise returns StandardHeight.
Examples
The following code illustrates how to get the row height for a particular row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Text = "Sample text";</para><para>worksheet["C2"].Style.Font.Size = 18;</para><para>//Set auto fit</para><para>worksheet.AutoFitRow(2);</para><para>//Get row height</para><para>Console.WriteLine(worksheet.GetRowHeightPixels(2));</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
int GetRowHeightPixels(
	int Row
)

Parameters

Row
Type: System Int32
One-bazed index of the row.

Return Value

Type: Int32
Height in pixels from RowRecord if there is corresponding RowRecord. Otherwise returns StandardHeight.
See Also