Skip to main content

TableView.GroupColumnFooterElementStyle Property

Gets or sets the style applied to individual text elements in the group summary item that is displayed within the group footer. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public Style GroupColumnFooterElementStyle { get; set; }

Property Value

Type Description
Style

A Style object that is the style applied to individual text elements in the group summary item that is displayed within the group footer.

Remarks

The GroupColumnFooterElementStyle property is in effect if the TableView.ShowGroupFooters property is set to true and the GridSummaryItem.ShowInGroupColumnFooter property is set to a required column name.

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

Example

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

WPF_Grid_GridGroupSummaryItemStyle

<dxg:GridControl x:Name="grid" ItemsSource="{Binding Collection}">
    <dxg:GridControl.Resources>
        <Style x:Key="SummaryStyle" TargetType="Run">
            <Setter Property="FontWeight" Value="Bold"/>
            <Style.Triggers>
                <DataTrigger Binding="{DXBinding '(int)Value le 40'}" Value="True">
                    <Setter Property="Foreground" Value="Red"/>
                </DataTrigger>
                <DataTrigger Binding="{DXBinding '(int)Value gt 40 and (int)Value lt 70'}" Value="True">
                    <Setter Property="Foreground" Value="Orange"/>
                </DataTrigger>
                <DataTrigger Binding="{DXBinding '(int)Value ge 70'}" Value="True">
                    <Setter Property="Foreground" Value="Green"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </dxg:GridControl.Resources>
    <dxg:GridControl.Columns>
        <dxg:GridColumn FieldName="City" GroupIndex="0" />
        <dxg:GridColumn FieldName="UnitPrice"/>
        <dxg:GridColumn FieldName="Quantity" />
    </dxg:GridControl.Columns>
    <dxg:GridControl.GroupSummary>
        <dxg:GridSummaryItem FieldName="UnitPrice" SummaryType="Sum" ShowInGroupColumnFooter="UnitPrice" />
    </dxg:GridControl.GroupSummary>
    <dxg:GridControl.View>
        <dxg:TableView x:Name="view" AutoWidth="True"
                       ShowGroupedColumns="True" ShowGroupFooters="True"
                       GroupColumnFooterElementStyle="{StaticResource SummaryStyle}">
        </dxg:TableView>
    </dxg:GridControl.View>
</dxg:GridControl>
See Also