Syncfusion.XlsIO.Base
Example 


Represents to collapse the group by rows/columns.

CollapseGroup Method

Collapses the group by rows/columns.
Syntax
'Declaration
 
Sub CollapseGroup( _
   ByVal groupBy As ExcelGroupBy _
) 
'Usage
 
Dim instance As IRange
Dim groupBy As ExcelGroupBy
 
instance.CollapseGroup(groupBy)
void CollapseGroup( 
   ExcelGroupBy groupBy
)

Parameters

groupBy
Represents to collapse the group by rows/columns.
Example
The following code illustrates how to collapse the group in the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
            
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet worksheet = workbook.Worksheets[0];
    
//Collapse group
worksheet.Range["A5:A15"].CollapseGroup(ExcelGroupBy.ByRows);
            
workbook.SaveAs("CollapseGroup.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also