Skip to main content
Row

RangeExtensions.Insert(CellRange, InsertCellsMode) Method

Inserts the cell range in the worksheet.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public static void Insert(
    this CellRange range,
    InsertCellsMode mode
)

Parameters

Name Type Description
range CellRange

A CellRange object specifying a cell range where new cells should be inserted.

mode InsertCellsMode

An InsertCellsMode enumeration member specifying in which direction to shift other cells.

Remarks

Use the Insert method to insert new cells at the position of the cell range. This is an extension method of the CellRange object that is called by using the instance method syntax.

You can insert a new range and shift other cells in the same column down, or shift other cells in the same row to the right. You can also insert empty rows and columns above or to the left of the cell range, respectively (the same number of rows or columns that comprise the range).

To delete cells, use the RangeExtensions.Delete method.

Another way to insert and delete cells in the worksheet is to use the worksheet’s Worksheet.InsertCells and Worksheet.DeleteCells methods (see the How to: Insert a Cell or Cell Range and How to: Delete a Cell or Range of Cells examples).

See Also