diff --git a/dotnet/src/dotnetframework/GxExcel/GxExcelEPPlus.cs b/dotnet/src/dotnetframework/GxExcel/GxExcelEPPlus.cs index 64a53a3dc..fb0c151df 100644 --- a/dotnet/src/dotnetframework/GxExcel/GxExcelEPPlus.cs +++ b/dotnet/src/dotnetframework/GxExcel/GxExcelEPPlus.cs @@ -824,16 +824,12 @@ public int BackColor for (int i = 1; i <= cntCells; i++) { - int val = (int)value; - int red = val >> 16 & 0xff; - int green = val >> 8 & 0xff; - int blue = val & 0xff; - - System.Drawing.Color color = System.Drawing.Color.FromArgb(red, green, blue); - - pCells[i].Style.Fill.BackgroundColor.SetColor(color); - } - + if (pCells[i].Style.Fill.PatternType == ExcelFillStyle.None) + { + pCells[i].Style.Fill.PatternType = ExcelFillStyle.Solid; + } + pCells[i].Style.Fill.BackgroundColor.SetColor(GXExcelHelper.ResolveColor(value)); + } } }