The Column.Delete() method is a fundamental tool in the DevExpress Spreadsheet Document API that allows developers to programmatically remove columns from a worksheet. Whether you’re building a WinForms, WPF, or server-side spreadsheet application, understanding how to delete columns efficiently — and when to use alternative approaches — is essential for robust spreadsheet manipulation.
What Is the Column.Delete() Method?
The Column.Delete() method belongs to the DevExpress.Spreadsheet namespace and is available through the DevExpress.Spreadsheet.v25.2.Core.dll assembly (NuGet package: DevExpress.Spreadsheet.Core). Its declaration is straightforward:
void Delete()Sub DeleteWhen called, the method removes the current Column object from the Worksheet.Columns collection. All columns to the right of the deleted column are automatically shifted left to fill the gap — behavior that mirrors what end users experience in Microsoft Excel.
One important detail to keep in mind: the total number of columns in a worksheet always remains 16,384. Deleting a column doesn’t reduce this count; instead, a new empty column is automatically appended to the end of the worksheet’s column collection to maintain that fixed total.
Three Ways to Delete Columns in DevExpress Spreadsheet
The API provides multiple methods for removing columns, each suited to different scenarios.
1. Column.Delete() — Remove a Single Column
Use this method when you have a direct reference to a Column object and want to remove it:
// Delete the 2nd column from the worksheet (zero-based index)
worksheet.Columns[1].Delete();' Delete the 2nd column from the worksheet
worksheet.Columns(1).Delete()2. ColumnCollection.Remove() — Remove by Index or Range
The Worksheet.Columns.Remove() method offers more flexibility. You can specify a column by its zero-based index or remove a batch of consecutive columns in a single call:
// Delete the 3rd column from the worksheet
worksheet.Columns.Remove(2);
// Delete three columns starting from the 10th column
worksheet.Columns.Remove(9, 3);' Delete the 3rd column from the worksheet
worksheet.Columns.Remove(2)
' Delete three columns starting from the 10th column
worksheet.Columns.Remove(9, 3)3. Worksheet.DeleteCells() with DeleteMode.EntireColumn
When you want to delete a column based on a cell reference rather than a column index, use Worksheet.DeleteCells() with the DeleteMode.EntireColumn parameter:
// Delete the column containing cell "B2"
worksheet.DeleteCells(worksheet.Cells["B2"], DeleteMode.EntireColumn);' Delete the column containing cell "B2"
worksheet.DeleteCells(worksheet.Cells("B2"), DeleteMode.EntireColumn)This approach is especially useful when your logic is cell-centric rather than column-centric — for example, when processing data based on cell addresses rather than fixed column positions.
Improving Performance with BeginUpdate / EndUpdate
When deleting multiple columns in a loop or sequence, wrapping your code inside Workbook.BeginUpdate() and Workbook.EndUpdate() calls significantly improves performance by suspending internal recalculations and UI updates until the operation is complete:
workbook.BeginUpdate();
try
{
worksheet.Columns[1].Delete();
worksheet.Columns.Remove(2);
worksheet.Columns.Remove(9, 3);
}
finally
{
workbook.EndUpdate();
}This is a best practice any time you perform batch modifications to a spreadsheet document.
Alternatives to Deleting Columns
Before reaching for Column.Delete(), consider whether one of these lighter-weight alternatives might better suit your use case.
Clearing Content or Formatting Only
If you want to remove data or styling from a column without restructuring the worksheet, use the Clear* methods available on the Worksheet object (e.g., ClearContents, ClearFormats). This leaves the column structure intact while wiping its content, formatting, hyperlinks, or comments — a non-destructive option that avoids shifting other columns.
Hiding Columns
If the goal is simply to conceal a column from view without permanently removing it, set the Column.Visible property to false:
worksheet.Columns[3].Visible = false;Hidden columns remain in the worksheet and can be revealed at any time, making this a reversible, non-destructive alternative.
Summary
The Column.Delete() method in the DevExpress Spreadsheet API is a clean, reliable way to remove columns from a worksheet programmatically. Here’s a quick recap of the key points:
Column.Delete()removes the current column and shifts remaining columns left.- The worksheet always maintains 16,384 columns — new empty columns are added at the end automatically.
- Use
ColumnCollection.Remove()for index-based or bulk column removal. - Use
Worksheet.DeleteCells()withDeleteMode.EntireColumnwhen working from cell references. - Wrap batch deletions in
BeginUpdate()/EndUpdate()for better performance. - Consider
Clear*methods orColumn.Visible = falsewhen full column deletion isn’t necessary.
For complete working examples, refer to the DevExpress Examples on GitHub or explore the related API references: ColumnCollection.Remove, Worksheet.DeleteCells, and the DevExpress.Spreadsheet namespace documentation.

