Style.CustomFormat propagates to other cells in range
Hello, we are using Xceed.Workbooks.NET to generate an Excel file and we've encountered an issue, where we set a custom date time format to the first column of the sheet like this:
- Sheet.Columns[0].Style.CustomFormat = customDateTimeformat;
Later on, we modify the Style property on a range of cells in every odd row.
- worksheet.Cells[rowIndex, startColumnIndex, rowIndex, endColumnIndex].Style.SetFillColor(ThemeColorType.Background1, -0.05);
The SetFillColor extension method modifies the Fill property of the Style property.
- style.Fill.PatternStyle = FillPattern.Solid;
- style.Fill.PatternThemeColor = new ThemeColor(index);
- style.Fill.BackgroundThemeColor = colorTint.HasValue ? new ThemeColor(index, colorTint.Value) : new ThemeColor(index);
When the SetFillColor extension method is called the CustomFormat value is propagated to all cells in the range that have DataType set to Number.
Best regards,
Safetica