Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IBorder Interface : ShowDiagonalLine Property

ShowDiagonalLine Property

This property is used only by Diagonal borders. For any other border index property will have no influence.
Syntax
'Declaration
 
Property ShowDiagonalLine As Boolean
'Usage
 
Dim instance As IBorder
Dim value As Boolean
 
instance.ShowDiagonalLine = value
 
value = instance.ShowDiagonalLine
bool ShowDiagonalLine {get; set;}
Example
The following code illustrates how to set visibility of the ExcelBordersIndex.DiagonalDown and ExcelBordersIndex.DiagonalUp borders.
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];
            
            //Set text
            worksheet["C2"].Text = "Sample";
            worksheet["D2"].Text = "text";
            worksheet["C3"].Text = "in";
            worksheet["D3"].Text = "cell";
            
            //Set borders
            IBorders borders = worksheet["C2:D3"].Borders;
            
            //Set color
            borders.Color = ExcelKnownColors.Red;
            
            //Set line style
            borders.LineStyle = ExcelLineStyle.Thick;
            
            //Set diagonal line visibility
            borders[ExcelBordersIndex.DiagonalDown].ShowDiagonalLine = false;
            borders[ExcelBordersIndex.DiagonalUp].ShowDiagonalLine = false;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also