Matt Colon Matt Colon - 1 year ago 234
C# Question

EPPlus Changing Border Color of cells

I'm trying to change the cell border color on a selected range. Couldn't find any other styles for cell borders other than for the weights of the borders as follows:

range.Style.Border.Top.Style = ExcelBorderStyle.Thin;
range.Style.Border.Left.Style = ExcelBorderStyle.Thin;
range.Style.Border.Right.Style = ExcelBorderStyle.Thin;
range.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;

Answer Source

If you want to sent border colors on different parts of the cells you can do it like this:


SetColor can take any kind of System.Drawing.Color.