Skip to main content
Row

Fill.PatternColor Property

Gets or sets the cell shading color.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

Color PatternColor { get; set; }

Property Value

Type Description
Color

A Color value that is the cell shading color.

Remarks

To specify the cell background characteristics, use the Fill.BackgroundColor, Fill.PatternType and PatternColor properties of the Fill object.

Note that the PatternColor property influences a cell’s appearance if the cell background pattern is other than PatternType.Solid or PatternType.None.

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

For examples on how to specify the format 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.

To specify the cell font color, use the SpreadsheetFont.Color property of the SpreadsheetFont object accessed via the Formatting.Font property. For details, review the How to: Change Cell Font and Background Color example.

Example

The following example specifies font and background colors for an individual cell and cell range:

View Example: Spreadsheet Document API Examples

using DevExpress.Spreadsheet;
using System.Drawing;
// ...

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

// Format a cell range.
CellRange range = worksheet.Range["C3:D4"];
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);

The following code snippets (auto-collected from DevExpress Examples) contain references to the PatternColor property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also