Syncfusion.XlsIO.Base
Example 


HasBorder Property (IExtendedFormat)

Returns true if the Cell has IBorder.
Syntax
'Declaration
 
ReadOnly Property HasBorder As Boolean
'Usage
 
Dim instance As IExtendedFormat
Dim value As Boolean
 
value = instance.HasBorder
bool HasBorder {get;}
Example
The following code ilustrats how to access HasBorder 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];
            
            //Set text
            worksheet["C2"].Text = "Sample";
            worksheet["E2"].Text = "Sample";
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set border
            style.Borders.Color = ExcelKnownColors.Blue;
            style.Borders.LineStyle = ExcelLineStyle.Thick;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["E2"].CellStyle;
            
            //Set border
            format.Borders.Color = ExcelKnownColors.Blue;
            format.Borders.LineStyle = ExcelLineStyle.Thick;
            
            //Check border
            Console.WriteLine(style.HasBorder);
            Console.WriteLine(format.HasBorder);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//True
//True
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also