Skip to main content

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.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public Style TotalSummaryElementStyle { get; set; }

Property Value

Type Description
Style

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

Remarks

The TotalSummaryElementStyle property is in effect if the DataViewBase.TotalSummaryPosition property is not set to None.

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.

Example

The code sample below changes the appearance of total summaries based on their values. This code sample uses the DXBinding mechanism to simplify the trigger definition.

WPF_Grid_GridTotalSummaryItemStyle

<dxg:GridControl.TotalSummary>
    <dxg:GridSummaryItem FieldName="UnitPrice" SummaryType="Max"/>
    <dxg:GridSummaryItem FieldName="UnitPrice" SummaryType="Min"/>
    <dxg:GridSummaryItem FieldName="Quantity" SummaryType="Max"/>
    <dxg:GridSummaryItem FieldName="Quantity" SummaryType="Min"/>
</dxg:GridControl.TotalSummary>
<dxg:GridControl.View>
    <dxg:TableView TotalSummaryPosition="Bottom">
        <dxg:TableView.TotalSummaryElementStyle>
            <Style TargetType="Run">
                <Setter Property="FontWeight" Value="Bold"/>
                <Style.Triggers>
                    <DataTrigger Binding="{DXBinding '(double)Value le 15'}" Value="True">
                        <Setter Property="Foreground" Value="Red"/>
                    </DataTrigger>
                    <DataTrigger Binding="{DXBinding '(double)Value gt 15'}" Value="True">
                        <Setter Property="Foreground" Value="Green"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </dxg:TableView.TotalSummaryElementStyle>
    </dxg:TableView>
</dxg:GridControl.View>
See Also