Back to Devexpress

DataViewBase.TotalSummaryElementStyle Property

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-7e509d06.md

latest3.3 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public Style TotalSummaryElementStyle { get; set; }
vb
Public Property TotalSummaryElementStyle As Style

Property Value

TypeDescription
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.

xaml
<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

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace