Articles in this section
Category / Section

How to change the style of the Pivot Grid

1 min read

Syncfusion PivotGridControl gives excellent support for the styling of cells by utilizing ControlTemplate property of Style.

XAML

<Style x:Key="valueCellStyle" TargetType="syncfusion:PivotGridTemplateCell">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="syncfusion:PivotGridTemplateCell">

<Grid>

<Grid.ColumnDefinitions>

<ColumnDefinition Width="*"/>

<ColumnDefinition Width="Auto"/>

</Grid.ColumnDefinitions>

<Border Height="10" BorderBrush="Red" Background="Red" Margin="2" HorizontalAlignment="Left"/>

<StackPanel Background="Crimson">

<TextBlock Grid.Column="1" Text="{Binding Path=Text, RelativeSource={RelativeSource TemplatedParent}}"

HorizontalAlignment="Right"

VerticalAlignment="Center" FontFamily="Calibri" FontSize="12"/>

</StackPanel>

</Grid>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

In PivotGridControl:

<syncfusion:PivotGridControl.ValueCellStyle>

<syncfusion:PivotGridCellStyle Style="{StaticResource valueCellStyle}"/>

</syncfusion:PivotGridControl.ValueCellStyle>

 

 

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-06-12 10.08.51.png

Figure: Pivot Grid shows customized Styles

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied