Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface : GetDefaultColumnStyle Method
One-based column index.

GetDefaultColumnStyle Method

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

Parameters

iColumnIndex
One-based column index.

Return Value

Default column style for the specified column or null if style wasn't set.
Example
The following code illustrates how to get default column 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.SetDefaultRowStyle(2, style);
            
            //Get default style
            IStyle defaultStyle = worksheet.GetDefaultColumnStyle(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