Method GroupRows
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
GroupRows(int, int, bool)
Groups rows, as Excel's Data > Group does: each row goes one outline level deeper.
public void GroupRows(int first, int last, bool collapsed = false)
Parameters
firstintThe first one-based row of the group.
lastintThe last one-based row of the group.
collapsedboolWhether the group is shown collapsed: its rows hidden and its summary row marked, as Excel's minus button leaves them.
Remarks
Rows already in a group go a level deeper, which nests the new group in the old one. Groups next to each other are one group, as in Excel. The summary row is the row below the group, or above it when OutlineSummaryBelow is false; a group with no row there has no button and cannot be marked collapsed.
Exceptions
- ArgumentOutOfRangeException
The rows are outside the worksheet grid, or
lastis beforefirst.- InvalidOperationException
The sheet is not a worksheet, or a row is already seven levels deep, as deep as Excel groups.
- InvalidDocumentException
The sheet's part is malformed.