All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

CellRange.FillColor Property

Gets or sets the cell background color.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.2.Core.dll

Declaration

Color FillColor { get; set; }
Property FillColor As Color
Color FillColor { get; set; }
Property FillColor As Color
Color FillColor { get; set; }
Property FillColor As Color

Property Value

Type Description
Color

A Color value that specifies the cell background color.

Property Value

Type Description
Color

A Color value that specifies the cell background color.

Property Value

Type Description
Color

A Color value that specifies the cell background color.

Remarks

You can also specify the background characteristics of a cell via the properties of the Fill object: Fill.BackgroundColor (this property is equal to FillColor), Fill.PatternType and Fill.PatternColor. When you specify FillColor or Fill.BackgroundColor for a cell with no background (Fill.PatternType is set to PatternType.None), this cell background pattern type is automatically changed to PatternType.Solid.

To access the Fill object, use the Formatting.Fill property.

For examples on how to specify formatting for an individual cell and cell range or modify a style, refer to the How to: Format a Cell or Range of Cells or How to: Create or Modify a Style document.

Examples

This example demonstrates how to format color characteristics (font and background colors) for an individual cell and range of cells.

// Format an individual cell.
worksheet.Cells["A1"].Font.Color = Color.Red;
worksheet.Cells["A1"].FillColor = Color.Yellow;

// Format a range of cells.
CellRange range = worksheet.Range["C3:H10"];
Formatting rangeFormatting = range.BeginUpdateFormatting();
rangeFormatting.Font.Color = Color.Blue;
rangeFormatting.Fill.BackgroundColor = Color.LightBlue;
rangeFormatting.Fill.PatternType = PatternType.LightHorizontal;
rangeFormatting.Fill.PatternColor = Color.Violet;
range.EndUpdateFormatting(rangeFormatting);
See Also