closedxml setting row height removes background color

600 Views Asked by At

I've tried every combination. The first row background color is always white if I set the height. ClosedXML 0.95.3

        using (var workbook = new XLWorkbook())
        {
            var toc = workbook.AddWorksheet("table of contents");
            toc.Style.Fill.SetBackgroundColor(XLColor.FromHtml("#16365C"));
            toc.Row(1).Height = 35;
            toc.Column(1).Width = 19;
            toc.Column(2).Width = 200;
            toc.Row(1).Style.Fill.SetBackgroundColor(XLColor.FromHtml("#16365C"));
            workbook.SaveAs(ms);
        }
1

There are 1 best solutions below

0
On

You can used this command in order to hide all the grids

workbook.Worksheet(SheetNme).SetShowGridLines (false);