ColumnCollection.Group(Int32, Int32, Boolean) Method
Groups the specified columns on a worksheet.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v26.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| first | Int32 | A zero-based integer representing the index of the first column to be grouped. |
| last | Int32 | A zero-based integer representing the index of the last column to be grouped. |
| collapse | Boolean | true, if the created group is collapsed; otherwise, false. |
Example
To group columns in a worksheet, call the ColumnCollection.Group method of the ColumnCollection object. This object represents a collection of all columns contained in a worksheet and is accessed using the Worksheet.Columns property. Pass the indexes of the first and last columns to be grouped, and a value indicating whether the new group should be expanded or collapsed.
Note that you can also place one group of columns inside another. But the number of nested groups is limited: you can create a maximum of seven levels of grouping.
// Group four columns starting from the third column "C" and expand the group.
worksheet.Columns.Group(2, 5, false);