Skip to content

SyncfusionExamples/styling-summary-rows-in-wpf-datagrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

styling-summary-rows-in-wpf-datagrid

The appearance of WPF DataGrid and its inner elements (example: Cell, Row, Header, Summary etc.) can be customized using various properties exposed and by editing the elements’ Style.

<Window.Resources>
    <!--Table summary cell style-->
    <Style TargetType="syncfusion:GridTableSummaryCell">
        <Setter Property="Background" Value="Beige"/>
        <Setter Property="Foreground" Value="Red" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="FontFamily" Value="Congenial Black"/>
        <Setter Property="FontWeight" Value="Bold" />
    </Style>
    <Style TargetType="syncfusion:TableSummaryRowControl">
        <Setter Property="Background" Value="Bisque"/>
        <Setter Property="FontStyle" Value="Italic"/>
        <Setter Property="Foreground" Value="Red"/>
    </Style>
    
    <!--Group summary cell style-->
    <Style TargetType="syncfusion:GridGroupSummaryCell">
        <Setter Property="Background" Value="Beige"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="Foreground" Value="DarkBlue"/>
        <Setter Property="FontStyle" Value="Oblique"/>
        <Setter Property="FontFamily" Value="Congenial Black"/>
        <Setter Property="FontSize" Value="14"/>
    </Style>
    
    <!--Group summary row style-->
    <Style TargetType="syncfusion:GroupSummaryRowControl">
        <Setter Property="Background" Value="Bisque"/>
    </Style>
    
    <!--Caption summary cell style-->
    <Style TargetType="syncfusion:GridCaptionSummaryCell">
        <Setter Property="Background" Value="Beige"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Foreground" Value="DarkBlue"/>
        <Setter Property="FontStyle" Value="Italic"/>
        <Setter Property="FontFamily" Value="Congenial Black"/>
        <Setter Property="FontSize" Value="14"/>
    </Style>

    <Style TargetType="syncfusion:CaptionSummaryRowControl"
           x:Key="captionSummaryRowStyle">
        <Setter Property="Background" Value="Bisque"/>
    </Style>
</Window.Resources>

Take a moment to peruse the WPF DataGrid - Styling documentation, to learn more about styles & templates code examples.

About

This example demonstrates how to customize the UI appearance of summary rows in WPF DataGrid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages