.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Column.Insert() Method

Inserts a new column into the worksheet.

Namespace: DevExpress.Spreadsheet

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


void Insert()


Use the Insert method to add a new column to the left of the current column. To add more than one column, use the ColumnCollection.Insert method.


The number of columns in a worksheet is unchanged - 16,384. When you add new columns, the equivalent number of columns at the end are automatically removed from the worksheet.

To copy data (for example, values, formulas, formatting, etc.) from one column to another one, use the CellRange.CopyFrom method. For details, see the How to: Copy a Row or Column example.


This example demonstrates how to insert new columns into a worksheet.

Enclose your code in the Workbook.BeginUpdate - Workbook.EndUpdate method calls to improve performance when you add multiple columns to a document.

// Insert a new column C.

// Insert a new column into the worksheet at the 5th position.

// Insert three columns into the worksheet at the 7th position.
worksheet.Columns.Insert(6, 3);

// Insert two columns to the left of the "L15:M16" cell range.
worksheet.InsertCells(worksheet.Range["L15:M16"], InsertCellsMode.EntireColumn);
See Also