Articles in this section
Category / Section

How to customize the value cells of PivotGrid Control

1 min read

It can be achieved by writing styles for Value Cells in PivotGrid Control. Please refer the below code snippet.


<Style x:Key="valStyle" TargetType="{x:Type syncfusion:PivotGridTemplateCell}">
                <Setter Property="MinHeight" Value="25"/>
                <Setter Property="Template">
                        <ControlTemplate TargetType="{x:Type syncfusion:PivotGridTemplateCell}">
                            <StackPanel  Grid.Column="1" Orientation="Horizontal" Background="Pink">
                                 <!--Image block-->
                                <Image Margin="2,4,1,0" Grid.Column="1" Source="{Binding ElementName=pivotGrid1, Converter={StaticResource imgConverter}}" VerticalAlignment="Top" HorizontalAlignment="Center">
                                        <Style TargetType="{x:Type Image}">
                                <TextBlock Grid.Column="1" Margin="3,4,2,0"
                                           Text="{Binding Path=Text, RelativeSource={RelativeSource TemplatedParent}}" 
                                           VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="12"


Figure: Pivot Grid shows cell templates applied to value cells



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