Skip to main content

IXlRow.BlankCells(Int32, XlCellFormatting) Method

Creates the specified number of empty cells to which specific formatting options are applied.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

void BlankCells(
    int count,
    XlCellFormatting formatting
)

Parameters

Name Type Description
count Int32

A positive integer that specifies the number of blank cells to be created.

formatting XlCellFormatting

An XlCellFormatting object that specifies formatting settings to be applied to the created cells.

If formatting is null, a System.ArgumentNullException exception occurs.

Example

The example below demonstrates how to use the IXlRow.BlankCells method to quickly generate multiple empty cells in a row that share the same formatting settings. Note that you can also use the IXlRow.BulkCells method to create row cells with the specified values and format characteristics.

For more information on how to create and format cells in a worksheet, see the Cells and Formatting example sections.

// Create a worksheet. 
using (IXlSheet sheet = document.CreateSheet())
{
    // Create the first row in the worksheet.                      
    using (IXlRow row = sheet.CreateRow())
    {
        // Create five successive cells in the row and set their background color to light blue.
        row.BlankCells(5, XlFill.SolidFill(Color.LightBlue));
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the BlankCells(Int32, XlCellFormatting) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also