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+
.NET Core 3.0+
Row

ColumnCollection Interface

A collection of all columns in a worksheet.

Namespace: DevExpress.Spreadsheet

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

Declaration

public interface ColumnCollection
Public Interface ColumnCollection
public interface ColumnCollection
Public Interface ColumnCollection
public interface ColumnCollection
Public Interface ColumnCollection

Remarks

Worksheet cells are organized into 1,048,576 rows and 16,384 columns. Columns are stored in the ColumnCollection object. Use the Worksheet.Columns property to access this object. The ColumnCollection.Item property enables you to get an individual column by its heading or index in the collection.

To add a new column to the worksheet, use the ColumnCollection.Insert method. To remove a column from the worksheet, use the ColumnCollection.Remove method. For details on how to manage worksheet columns, see the Rows and Columns section of examples.

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;
// ...

IWorkbook workbook = spreadsheetControl1.Document;

// 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