Back to Devexpress

ColumnCollection.Remove(String, String) Method

officefileapi-devexpress-dot-spreadsheet-dot-columncollection-dot-remove-x28-system-dot-string-system-dot-string-x29.md

latest3.1 KB
Original Source

ColumnCollection.Remove(String, String) Method

Removes multiple columns from a worksheet.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Remove(
    string firstColumnHeading,
    string lastColumnHeading
)
vb
Sub Remove(
    firstColumnHeading As String,
    lastColumnHeading As String
)

Parameters

NameTypeDescription
firstColumnHeadingString

The heading of the first column to remove.

| | lastColumnHeading | String |

The heading of the last column to remove.

|

Remarks

The method’s firstColumnHeading and lastColumnHeading parameters require column headings in the A1 reference style.

csharp
// Remove three columns from the worksheet.
worksheet.Columns.Remove("D", "F");
vb
' Remove three columns from the worksheet.
worksheet.Columns.Remove("D", "F")

Note

The number of columns in a worksheet is unchanged - 16,384. When you delete columns, other columns in the worksheet are shifted to the left and the equivalent number of new columns is automatically added to the end of the worksheet’s column collection.

See how to delete rows and columns from a worksheet.

If you need to delete the cell content or format settings from columns, use the Worksheet object’s Clear* methods.

See how to clear cells of content, formatting, hyperlinks and comments.

Use the Column.Visible property or ColumnCollection.Hide methods to hide columns in a worksheet.

See how to hide a row or column.

See Also

ColumnCollection Interface

ColumnCollection Members

DevExpress.Spreadsheet Namespace