Worksheet.Columns Property
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v18.2.Core.dll
Declaration
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.
Example
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"];
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Columns property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.