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

Commented Issue: XLCell.Clear(XLClearOptions.ContentsAndFormats) does not clear the border for merged cells properly [7925]

$
0
0
Greetings again. Please see the attached example. If you have a merged cell that is composed of say, B2:J17, and this cell (range really I guess) has a border around it, and you call wb.Worksheet(1).Cell("B2").Clear(XLClearOptions.ContentsAndFormats), *only* the border around B2 will be cleared, and not the entire range. Interestingly, if the merged cell has a background color, that DOES seem to be cleared.
Comments: The problem was that we were not checking if the cell was part of a Merged Range before clearing, so we were only clearing the one cell, and not all the merged cells. Before the fix, I noticed a weird behavior where if you unmerged the attached example's output, you would see all the original formatting, except for the upper left corner. I have fixed this in the following pull request. https://closedxml.codeplex.com/SourceControl/network/forks/NickNack2020/ClosedXml/changeset/d140646c700a8ddd411790e0116f908dd7404192

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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