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

Worksheet.Columns Property

Provides access to the collection of all columns contained in the worksheet.

Namespace: DevExpress.Spreadsheet

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


ColumnCollection Columns { get; }
ReadOnly Property Columns As ColumnCollection

Property Value

Type Description

A ColumnCollection object specifying the worksheet's collection of columns.


Use the Columns property to access an individual column in the worksheet or perform different operations over individual or multiple columns (for example, group, insert or delete columns).

To work with worksheet rows, use the RowCollection object accessed via the Worksheet.Rows property.


This example demonstrates how to access columns in a worksheet. Use the Worksheet.Columns property to get a collection of columns contained in a worksheet (the ColumnCollection object). To get an individual column by its index (zero-based) or heading ("A", "B", "C", etc.), use the ColumnCollection.Item property.

using DevExpress.Spreadsheet;
// ...

Workbook workbook = new Workbook();

// Access a collection of columns.
ColumnCollection columns = workbook.Worksheets[0].Columns;

// Access the first column by its index in the collection of columns.
Column firstColumn_byIndex = columns[0];

// Access the first column by its unique name.
Column firstColumn_byName = columns["A"];
See Also