[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Collapse]Appearance
     Pivot Grid Styles
     Pivot Grid Elements That Support Templates
     Customizing Pivot Grid Colors
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Customizing Pivot Grid Colors

PivotGridControl exposes properties that allow you to customize colors of its cells and field values.

You can either set these properties directly or create a style targeting the PivotGridControl that will specify the required colors.

The following table lists pivot grid properties used to customize cell and field value colors.

Property Description
PivotGridControl.CellBackground Gets or sets the brush used to paint the background of data cells. This is a dependency property.
PivotGridControl.CellForeground Gets or sets the brush used to paint the foreground of data cells. This is a dependency property.
PivotGridControl.CellSelectedBackground Gets or sets the brush used to paint the background of the selected data cell. This is a dependency property.
PivotGridControl.CellSelectedForeground Gets or sets the brush used to paint the foreground of the selected data cell. This is a dependency property.
PivotGridControl.CellTotalBackground Gets or sets the brush used to paint the background of total and grand total cells. This is a dependency property.
PivotGridControl.CellTotalForeground Gets or sets the brush used to paint the foreground of total and grand total cells. This is a dependency property.
PivotGridControl.CellTotalSelectedBackground Gets or sets the brush used to paint the background of the selected total or grand total Cell. This is a dependency property.
PivotGridControl.CellTotalSelectedForeground Gets or sets the brush used to paint the foreground of the selected total or grand total Cell. This is a dependency property.
PivotGridControl.ValueBackground Gets or sets the brush used to paint the background of Field Value cells. This is a dependency property.
PivotGridControl.ValueForeground Gets or sets the brush used to paint the foreground of Field Value cells. This is a dependency property.
PivotGridControl.ValueSelectedBackground Gets or sets the brush used to paint the background of the selected Field Value cell. This is a dependency property.
PivotGridControl.ValueSelectedForeground Gets or sets the brush used to paint the foreground of the selected Field Value cell. This is a dependency property.
PivotGridControl.ValueTotalBackground Gets or sets the brush used to paint the background of total and grand total headers. This is a dependency property.
PivotGridControl.ValueTotalForeground Gets or sets the brush used to paint the foreground of total and grand total headers. This is a dependency property.
PivotGridControl.ValueTotalSelectedBackground Gets or sets the brush used to paint the background of the selected total or grand total header. This is a dependency property.
PivotGridControl.ValueTotalSelectedForeground Gets or sets the brush used to paint the foreground of the selected total or grand total header. This is a dependency property.

Expanded Example

The following example demonstrates how to create a custom style for a pivot grid.

In this example, we create and apply a style that sets custom colors for pivot grid cells and field values.

The following image shows the result:

Is this topic helpful?​​​​​​​