How do I make OutlineLevel to collapse or expand.
I use SetColOutlineLevel or SetRowOutlineLevel to set an OutlineLevel and it is expanded by default.
xls.CollapseOutlineRows() or xls.CollapseOutlineCols()
will collapse all rows.
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.