The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Worksheet.Columns Property

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

Namespace: DevExpress.Spreadsheet

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

Declaration

ColumnCollection Columns { get; }
ReadOnly Property Columns As ColumnCollection
ColumnCollection Columns { get; }
ReadOnly Property Columns As ColumnCollection

Property Value

Type Description
ColumnCollection

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

Property Value

Type Description
ColumnCollection

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

Remarks

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.

Examples

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