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

RowCollection.Group(Int32, Int32, Boolean) Method

Groups the specified rows on a worksheet.

Namespace: DevExpress.Spreadsheet

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


void Group(
    int first,
    int last,
    bool collapse
Sub Group(
    first As Integer,
    last As Integer,
    collapse As Boolean


Name Type Description
first Int32

A zero-based integer representing the index of the first row to be grouped.

last Int32

A zero-based integer representing the index of the last row to be grouped.

collapse Boolean

true, if the created group is collapsed; otherwise, false.


To group rows in a worksheet, call the RowCollection.Group method of the RowCollection object. This object represents a collection of all rows contained in a worksheet and is accessed via the Worksheet.Rows property. Pass the indexes of the first and last rows 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 rows inside another. But the number of nested groups is limited: you can create a maximum of seven levels of grouping. The example below demonstrates how two create two levels of grouping.

' Group four rows starting from the third row and collapse the group.
worksheet.Rows.Group(2, 5, True)

' Group four rows starting from the ninth row and expand the group.
worksheet.Rows.Group(8, 11, False)

' Create the outer group of rows by grouping rows 2 through 13. 
worksheet.Rows.Group(1, 12, False)
See Also