We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

URGENT : Collapse Expand grouping

How to expand or collapse all groupings in aspose.total for .NET?

This message was posted using Aspose.Live 2 Forum


Please see the document:

You may use Cells.GroupRows(firstIndex, lastIndex, isHidden) —> put true or false to make the collapsed or expanded.

Thank you.

Thanks Amjad for your response. Presume the grouping is already done by a different process based on some logic and my grouping is not collapsed and remains expanded.

now, I would like to collapse all the groupings with out bothering about the indices.

I would want to do this functionality simlar to the one below:

Cells.Groups.All.Expand() or Cells.Groups.All.Collapse()

The grouping gets expanded automatically because of the other formatting which happens post the group rows - I have no control on the grouping logic as it is done by a separate application.

Is there any work around or what would cause a grouping to expand automatically and have it collapsed all the time?




Well, I think you may try to use HideGroupDetail and ShowGroupDetail methods of Worksheet.Cells object, see the sample code below:

Workbook book = new Workbook(“e:\test\Book1.xls”);
Worksheet sheet = book.Worksheets[0];

for(int i = 0; i<= sheet.Cells.MaxRow;i++)
//Collapse all the grouped rows.
sheet.Cells.HideGroupDetail(true, i);


Thank you.