# Customize Pivot Grid Colors | WPF Controls | DevExpress Documentation

This topic lists properties you can use to change the color of the PivotGridControl’s elements.

Set these properties directly or create a style that targets the PivotGridControl and specify the colors.

## Standard Control Properties

You can use the [Control](https://learn.microsoft.com/dotnet/api/system.windows.controls.control) properties to change the color of the PivotGridControl’s elements:

- [BorderBrush](https://learn.microsoft.com/dotnet/api/system.windows.controls.control.borderbrush#system-windows-controls-control-borderbrush)
- [Background](https://learn.microsoft.com/dotnet/api/system.windows.controls.control.background#system-windows-controls-control-background)
- [Foreground](https://learn.microsoft.com/dotnet/api/system.windows.controls.control.foreground#system-windows-controls-control-foreground)

## PivotGridControl Properties

You can use the [PivotGridControl](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl) properties to change the colors of cell and field values.

| Property | Description |
| --- | --- |
| [CellBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellBackground) | Gets or sets the brush used to paint the background of [data cells](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellForeground) | Gets or sets the brush used to paint the foreground of [data cells](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellSelectedBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellSelectedBackground) | Gets or sets the brush used to paint the background of the selected [data cell](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellSelectedForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellSelectedForeground) | Gets or sets the brush used to paint the foreground of the selected [data cell](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellTotalBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellTotalBackground) | Gets or sets the brush used to paint the background of total and grand total [cells](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellTotalForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellTotalForeground) | Gets or sets the brush used to paint the foreground of total and grand total [cells](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellTotalSelectedBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellTotalSelectedBackground) | Gets or sets the brush used to paint the background of the selected total or grand total [cell](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [CellTotalSelectedForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.CellTotalSelectedForeground) | Gets or sets the brush used to paint the foreground of the selected total or grand total [cell](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell). This is a dependency property. |
| [ValueBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueBackground) | Gets or sets the brush used to paint the background of [field value](/WPF/7995/controls-and-libraries/pivot-grid/ui-elements/field-value) cells. This is a dependency property. |
| [ValueForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueForeground) | Gets or sets the brush used to paint the foreground of [field value](/WPF/7995/controls-and-libraries/pivot-grid/ui-elements/field-value) cells. This is a dependency property. |
| [ValueSelectedBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueSelectedBackground) | Gets or sets the brush used to paint the background of the selected [field value](/WPF/7995/controls-and-libraries/pivot-grid/ui-elements/field-value) cell. This is a dependency property. |
| [ValueSelectedForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueSelectedForeground) | Gets or sets the brush used to paint the foreground of the selected [field value](/WPF/7995/controls-and-libraries/pivot-grid/ui-elements/field-value) cell. This is a dependency property. |
| [ValueTotalBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueTotalBackground) | Gets or sets the brush used to paint the background of [total](/WPF/8006/controls-and-libraries/pivot-grid/ui-elements/totals) and [grand total](/WPF/8001/controls-and-libraries/pivot-grid/ui-elements/grand-totals) headers. This is a dependency property. |
| [ValueTotalForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueTotalForeground) | Gets or sets the brush used to paint the foreground of [total](/WPF/8006/controls-and-libraries/pivot-grid/ui-elements/totals) and [grand total](/WPF/8001/controls-and-libraries/pivot-grid/ui-elements/grand-totals) headers. This is a dependency property. |
| [ValueTotalSelectedBackground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueTotalSelectedBackground) | Gets or sets the brush used to paint the background of the selected [total](/WPF/8006/controls-and-libraries/pivot-grid/ui-elements/totals) or [grand total](/WPF/8001/controls-and-libraries/pivot-grid/ui-elements/grand-totals) header. This is a dependency property. |
| [ValueTotalSelectedForeground](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ValueTotalSelectedForeground) | Gets or sets the brush used to paint the foreground of the selected [total](/WPF/8006/controls-and-libraries/pivot-grid/ui-elements/totals) or [grand total](/WPF/8001/controls-and-libraries/pivot-grid/ui-elements/grand-totals) header. This is a dependency property. |

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:

![Appearance-Custom-Style](/WPF/images/appearance-custom-style16289.png)

- MainWindow.xaml

<section id="tabpanel_KDi6bktarY_tabid-xamlMainWindow-xaml" role="tabpanel" data-tab="tabid-xamlMainWindow-xaml">
<pre><code class="lang-xaml">&lt;Window xmlns:dxpg=&quot;http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid&quot;
        xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot;
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
        x:Class=&quot;DXPivotGrid_CustomizeBrushes.MainWindow&quot;
        dx:ThemeManager.ThemeName=&quot;Office2010Black&quot;
        Height=&quot;600&quot; Width=&quot;800&quot;
        Title=&quot;Main Window&quot;&gt;
    &lt;Grid&gt;
        &lt;Grid.Resources&gt;
            &lt;Style x:Key=&quot;pivotGridCustomStyle&quot; TargetType=&quot;dxpg:PivotGridControl&quot;&gt;
                &lt;Setter Property=&quot;CellBackground&quot; Value=&quot;#b4c7ff&quot;/&gt;
                &lt;Setter Property=&quot;CellForeground&quot; Value=&quot;Black&quot;/&gt;
                &lt;Setter Property=&quot;CellSelectedBackground&quot; Value=&quot;#888ea0&quot;/&gt;
                &lt;Setter Property=&quot;CellSelectedForeground&quot; Value=&quot;White&quot;/&gt;
                &lt;Setter Property=&quot;CellTotalBackground&quot; Value=&quot;#7599ff&quot;/&gt;
                &lt;Setter Property=&quot;CellTotalForeground&quot; Value=&quot;Black&quot;/&gt;
                &lt;Setter Property=&quot;CellTotalSelectedBackground&quot; Value=&quot;#51555f&quot;/&gt;
                &lt;Setter Property=&quot;CellTotalSelectedForeground&quot; Value=&quot;White&quot;/&gt;
                &lt;Setter Property=&quot;ValueBackground&quot; Value=&quot;#f3dfaa&quot;/&gt;
                &lt;Setter Property=&quot;ValueForeground&quot; Value=&quot;Black&quot;/&gt;
                &lt;Setter Property=&quot;ValueSelectedBackground&quot; Value=&quot;#888ea0&quot;/&gt;
                &lt;Setter Property=&quot;ValueSelectedForeground&quot; Value=&quot;White&quot;/&gt;
                &lt;Setter Property=&quot;ValueTotalBackground&quot; Value=&quot;#f1c44a&quot;/&gt;
                &lt;Setter Property=&quot;ValueTotalForeground&quot; Value=&quot;Black&quot;/&gt;
                &lt;Setter Property=&quot;ValueTotalSelectedBackground&quot; Value=&quot;#51555f&quot;/&gt;
                &lt;Setter Property=&quot;ValueTotalSelectedForeground&quot; Value=&quot;White&quot;/&gt;
            &lt;/Style&gt;
        &lt;/Grid.Resources&gt;
        &lt;dxpg:PivotGridControl Style=&quot;{StaticResource ResourceKey=pivotGridCustomStyle}&quot;
                               Name=&quot;pivotGridControl1&quot; &gt;
            &lt;dxpg:PivotGridControl.Fields&gt;
                &lt;dxpg:PivotGridField Name=&quot;fieldYear&quot; FieldName=&quot;OrderDate&quot; Area=&quot;ColumnArea&quot;
                                     Caption=&quot;Year&quot; GroupInterval=&quot;DateYear&quot;/&gt;
                &lt;dxpg:PivotGridField Name=&quot;fieldCategoryName&quot; FieldName=&quot;CategoryName&quot;
                                     Area=&quot;RowArea&quot; Caption=&quot;Category&quot;/&gt;
                &lt;dxpg:PivotGridField Name=&quot;fieldProductName&quot; FieldName=&quot;ProductName&quot;
                                     Area=&quot;RowArea&quot; Caption=&quot;Product&quot;/&gt;
                &lt;dxpg:PivotGridField Name=&quot;fieldQuantity&quot; FieldName=&quot;Quantity&quot; Area=&quot;DataArea&quot;/&gt;
            &lt;/dxpg:PivotGridControl.Fields&gt;
        &lt;/dxpg:PivotGridControl&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;
</code></pre></section>