This project has moved. For the latest updates, please go here.

Merging cells makes hidden value

Nov 24, 2014 at 11:27 PM
Hello
IXLRange.Merge() makes hidden value.

e.g.
// Merge and save
XLWorkbook workBook = new XLWorkbook(textBox1.Text);
IXLWorksheet sheet = workBook.Worksheet(1);

sheet.Cell("A1").Value = "A1Value";
sheet.Cell("A2").Value = "A2Value";
sheet.Cell("A1").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
sheet.Cell("A2").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;

sheet.Range("A1:A2").Merge();

workBook.Save();

...

// Refer merged cell
XLWorkbook workBook = new XLWorkbook(textBox1.Text);
IXLWorksheet sheet = workBook.Worksheet(1);

Debug.Assert(sheet.Range("A1:A2").IsMerged());

IXLCell a2cell = sheet.Cell("A2");

XLBorderStyleValues a2TopBorder = a2cell.Style.Border.TopBorder; // <- Thin (not None)
string a2value = a2cell.Value.ToString();                          // <- "A2Value" (not "")
Do I have to add code to clear hidden value?
ClosedXML version is 0.75.0.

Thanks.