Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface : GetRowHeightInPixels Method
One-based row index.

GetRowHeightInPixels Method

Returns the height of the specified row in pixels.
Syntax
'Declaration
 
Function GetRowHeightInPixels( _
   ByVal iRowIndex As Integer _
) As Integer
'Usage
 
Dim instance As IWorksheet
Dim iRowIndex As Integer
Dim value As Integer
 
value = instance.GetRowHeightInPixels(iRowIndex)
int GetRowHeightInPixels( 
   int iRowIndex
)

Parameters

iRowIndex
One-based row index.

Return Value

Returns height of the specified row in pixels. Otherwise returns StandardHeight.
Example
The following code illustrates how to get the row height for a particular row.
using Syncfusion.XlsIO;
using System;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Load data
            worksheet["C2"].Value = "Sample text";
            
            //Create style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set font
            IFont font = style.Font;
            
            //Set font size
            font.Size = 18;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Set auto fit
            worksheet.AutofitRow(2);
            
            //Get row width
            Console.WriteLine(worksheet.GetRowHeightInPixels(2));
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//29
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also