Skip to main content
Row

RowCollection.Insert(Int32, Int32, RowFormatMode) Method

Inserts multiple rows and specifies how to format these rows.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

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

Parameters

Name Type Description
index Int32

A zero-based index of the first row to insert. If the index is negative or exceeds the last available index (1048575), an exception occurs.

count Int32

The number of rows to insert.

formatMode RowFormatMode

An enumeration member that specifies how to format inserted rows.

Remarks

The number of rows in a worksheet does not change—1,048,576. When you add new rows, the rows below are shifted down and an equivalent number of rows at the end of the worksheet is removed.

The following example inserts two rows above the second row in a worksheet and applies the same format as the first row to these rows:

// Insert two rows with the same formatting as the first row.
worksheet.Rows.Insert(1, 2, RowFormatMode.FormatAsPrevious);

Insert rows and specify format options

See Also