Syncfusion.XlsIO.Base
Example 


HasStyle Property

Gets a Boolean value indicating whether Range has default style. False means default style. Read-only.
Syntax
'Declaration
 
ReadOnly Property HasStyle As Boolean
'Usage
 
Dim instance As IRange
Dim value As Boolean
 
value = instance.HasStyle
bool HasStyle {get;}
Example
The following code illustrates how to access HasStyle property.
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];
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set color
            style.ColorIndex = ExcelKnownColors.Red;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Check HasStyle
            Console.Write(worksheet["C2"].HasStyle);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//True
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also