DataViewBase.TotalSummaryElementStyle Property

Gets or sets the style applied to individual text elements in the total summary items within a view. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v21.2.Core.dll


public Style TotalSummaryElementStyle { get; set; }

Property Value

Type Description

A Style object that is the style applied to individual text elements in the total summary item.


The TotalSummaryElementStyle property is in effect if the DataViewBase.ShowTotalSummary property is set to true.

Use the TotalSummaryElementStyle property to define the text element style for all the summaries within a view. To define the text element style for an individual summary item, use the summary item’s SummaryItemBase.TotalSummaryElementStyle property.


The code sample below demonstrates how to change the appearance of total summary items depending on the summary value. This code sample uses the DXBinding mechanism to simplify the trigger definition.


<dxg:GridControl x:Name="grid" ItemsSource="{Binding Collection}">
        <Style x:Key="SummaryStyle" TargetType="Run">
            <Setter Property="FontWeight" Value="Bold"/>
                <DataTrigger Binding="{DXBinding '(int)Value le 70'}" Value="True">
                    <Setter Property="Foreground" Value="Red"/>
                <DataTrigger Binding="{DXBinding '(int)Value gt 70'}" Value="True">
                    <Setter Property="Foreground" Value="Green"/>
        <dxg:GridColumn FieldName="City"/>
        <dxg:GridColumn FieldName="UnitPrice"/>
        <dxg:GridColumn FieldName="Quantity" />
        <dxg:GridSummaryItem FieldName="UnitPrice" SummaryType="Count"/>
        <dxg:GridSummaryItem FieldName="Quantity" SummaryType="Sum"/>
        <dxg:TableView x:Name="view"
                       TotalSummaryElementStyle="{StaticResource SummaryStyle}">
See Also