Category / Section
How do I group Rows and Columns
1 min read
The IRange class has the Group and Ungroup methods that can be used for grouping and ungrouping rows and columns in a worksheet.
C#
//Grouping Rows and Columns mySheet.Range["A1:A5"].Group(ExcelGroupBy.ByRows); mySheet.Range["A1:E1"].Group(ExcelGroupBy.ByColumns);
VB
'Grouping Rows and Columns mySheet.Range("A1:A5").Group(ExcelGroupBy.ByRows) mySheet.Range("A1:E1").Group(ExcelGroupBy.ByColumns)
Here is the sample for your reference:
https://www.syncfusion.com/downloads/support/directtrac/89898/GroupingandUnGrouping1992232692.zip