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

RowCollection.Insert(Int32, Int32, RowFormatMode) Method

Inserts multiple rows into the worksheet and specifies insert options.

Namespace: DevExpress.Spreadsheet

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

Declaration

void Insert(
    int index,
    int count,
    RowFormatMode formatMode
)

Parameters

Name Type Description
index Int32

An integer specifying the zero-based index of the position where new rows shall be inserted. If it is negative or exceeds the last available index (1048575), an exception is raised.

count Int32

An integer specifying the number of rows to be inserted.

formatMode RowFormatMode

One of the RowFormatMode enumeration members specifying how to format inserted rows.

Remarks

The number of rows in a worksheet is unchanged - 1,048,576. When you add new rows, other rows in the worksheet are shifted down and the equivalent number of rows at the end are automatically removed from the worksheet.

The formatMode parameter allows you to specify how to format inserted rows:

RowFormatMode

Description

RowFormatMode.FormatAsPrevious

Inserted rows have the same formatting as the row above:

Spreadsheet_RowFormatMode_FormatAsPrevious

RowFormatMode.FormatAsNext

Inserted rows have the same formatting as the row below:

Spreadsheet_RowFormatMode_FormatAsNext

RowFormatMode.None

Inserted rows have no formatting applied:

Spreadsheet_RowFormatMode_FormatAsNone

See Also