Syncfusion.XlsIO.Base
Example 


HasBorder Property (IDataBar)

Gets a Boolean value indicating whether the data bar has a border.
Syntax
'Declaration
 
ReadOnly Property HasBorder As Boolean
'Usage
 
Dim instance As IDataBar
Dim value As Boolean
 
value = instance.HasBorder
bool HasBorder {get;}
Remarks
Setting color to BorderColor property makes the HasBorder to return "True".
Example
By default there will be no color set to BorderColor property, So HasBorder property will return "False". If we set color to BorderColor property then the HasBorder property will return "True". Here in our example, we check the HasBorder property before applying Border color and after applying Border color.
using Syncfusion.XlsIO;
using System;
using System.Drawing;
            
class Example
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create a worksheet.        
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;            
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Load data to Apply Conditional Formatting.
            worksheet["A1"].Text = "DataBar";
            worksheet["A2"].Number = 10;
            worksheet["A3"].Number = 20;
            worksheet["A4"].Number = 30;
            worksheet["A5"].Number = 40;
            worksheet["A6"].Number = 50;
            worksheet["A7"].Number = 60;
            worksheet["A8"].Number = 70;
            worksheet["A9"].Number = 80;
            worksheet["A10"].Number = 90;
            worksheet["A11"].Number = 100;
            
            //Create instance of IConditonalFormat and IConditionalFormats.
            IConditionalFormats formats = worksheet["A2:A11"].ConditionalFormats;
            IConditionalFormat format = formats.AddCondition();
            
            //Set FormatType as DataBar.
            format.FormatType = ExcelCFType.DataBar;
            IDataBar dataBar = format.DataBar;
            
            //Before Applying Border color
            Console.WriteLine(dataBar.HasBorder);
            
            //Set Border color for DataBar
            dataBar.BorderColor = Color.Yellow;
            
            //After Applying Border color
            Console.WriteLine(dataBar.HasBorder);
            
            //Save and Dispose.
            workbook.SaveAs("ConditionalFormats.xlsx");
            workbook.Close();
            Console.Read();
        }
    }
}
// Output in the console will be
// False
// True
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also