Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Created Unassigned: Cannot remove OutlineLevel [9238]

$
0
0
I have a grouping (outline) in the original sheet being loaded and try to remove that grouping, but the grouping remains.

This works fine when the OutLine is added programatically and then removed programatically (via ungroup()).


var wb = new XLWorkbook("C:/Temp/OutlineInput.xlsx");
var ws = wb.Worksheets.First();
var outlinedRows = new List<IXLRow>();
ws.RowsUsed().ForEach(r => {
if (r.OutlineLevel > 0)
{
r.Ungroup(true);
outlinedRows.Add(r);
}
});

When changing XLWorkbook_Save.cs to always save the OutlineLevel to the native row object it seems to work.

// if (thisRow.OutlineLevel > 0)
row.OutlineLevel = (byte)thisRow.OutlineLevel;

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>