Syncfusion.XlsIO.Base
Example 


FillPattern Property (IExtendedFormat)

Gets / Sets fill pattern.
Syntax
'Declaration
 
Property FillPattern As ExcelPattern
'Usage
 
Dim instance As IExtendedFormat
Dim value As ExcelPattern
 
instance.FillPattern = value
 
value = instance.FillPattern
ExcelPattern FillPattern {get; set;}
Example
By default fill pattern will be set to ExcelPattern.None so patterns will not be visbile. Here for example, we set ExcelPattern.VerticalStripe to fill pattern.
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];
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set pattern
            style.FillPattern = ExcelPattern.VerticalStripe;
            
            //Set pattern color
            style.PatternColorIndex = ExcelKnownColors.Red;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["E2"].CellStyle;
            
            //Set pattern
            format.FillPattern = ExcelPattern.VerticalStripe;
            
            //Set pattern color
            format.PatternColorIndex = ExcelKnownColors.Red;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also