How to change the style of the Pivot Grid
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>
|
Figure: Pivot Grid shows customized Styles