Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

ColumnCollection.Insert(String, Int32) Method

Inserts multiple columns into the worksheet.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll

Declaration

void Insert(
    string columnHeading,
    int count
)

Parameters

Name Type Description
columnHeading String

The heading of the first column to insert. Specify headings in the A1 reference style.

count Int32

The number of columns to insert.

Remarks

The number of columns in a worksheet does not change—16,384. When you add new columns, other columns in the worksheet are shifted to the right, and an equivalent number of columns at the end of the worksheet is removed.

The following example demonstrates how to add multiple columns to a worksheet:

// Insert three columns (from column "B" to column "D").
worksheet.Columns.Insert(1, 3);

// Insert two columns starting with column "F".
worksheet.Columns.Insert("F", 2);

Insert multiple columns

See Also