Syncfusion.XlsIO.Base
Example 


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

GetDefaultRowStyle Method

Returns default row style for the specified row.
Syntax
'Declaration
 
Function GetDefaultRowStyle( _
   ByVal iRowIndex As Integer _
) As IStyle
'Usage
 
Dim instance As IWorksheet
Dim iRowIndex As Integer
Dim value As IStyle
 
value = instance.GetDefaultRowStyle(iRowIndex)
IStyle GetDefaultRowStyle( 
   int iRowIndex
)

Parameters

iRowIndex
One-based row index.

Return Value

Default row style for the specified row or null if style wasn't set.
Example
The following code illustrates how to get default row style.
using Syncfusion.XlsIO;
            
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];
            
            //Create style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set color
            style.ColorIndex = ExcelKnownColors.Red;
            
            //Set default style
            worksheet.SetDefaultColumnStyle(2, style);
            
            //Get default style
            IStyle defaultStyle = worksheet.GetDefaultRowStyle(3);
            
            //Set color
            defaultStyle.ColorIndex = ExcelKnownColors.Blue;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also