0

As stated in the title i would like to use Gembox to colorify an entire row in a Excell document with a color selected at runtime.

I have tried the following code :

      ef.LoadXls("path"), XlsOptions.PreserveAll);
      ef.Worksheets[0].Rows[myRowIndex].Style.FillPattern.SetPattern ( FillPatternStyle.None , Color.Black , selectedColor );

but seem not work (i have no exception but row remain white), any suggestion to do what i need ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Skary
  • 1,322
  • 1
  • 13
  • 40

1 Answers1

2

Instead of FillPatternStyle.None use FillPatternStyle.Solid, try the following:

// When solid is specified, the PatternForegroundColor is the only color that's rendered.
ef.Worksheets[0].Rows[myRowIndex].Style
    .FillPattern
    .SetPattern(FillPatternStyle.Solid, selectedColor, Color.Empty);
Mario Z
  • 4,328
  • 2
  • 24
  • 38