How do I make OutlineLevel to collapse or expand.
I use SetColOutlineLevel or SetRowOutlineLevel to set an OutlineLevel and it is expanded by default.

Thank you.


xls.CollapseOutlineRows()  or xls.CollapseOutlineCols()

For example:
xls.CollapseOutlineRows(1, TCollapseChildrenMode.Collapsed)
will collapse all rows.

xls.CollapseOutlineRows(8, TCollapseChildrenMode.Expanded)
Will expand the full thing.

You can see at the "collapseoutline" methods as the same as pressing the "1", "2"... numbers in Excel. You might press 1 to collapse everrything, then 2 to expand the second level. You can so the same in FlexCel by calling the 2 equivalent commands.

There are other options in the overload of the the method, like for example to collapse just a part of the outline.

As a note that might be interesting, "collapsing" and "expanding" outlines just hide or show rows/columns.
so, while it is easier to use "CollapseOutlineRows" to collapse or expand rows, you could do exactly the same by hiding the rows in the outline. If you hide the needed rows, Excel will show the outline collapsed and viceversa. This is just as a side note, since you can just use CollapseOutline methods that are easier to use.