Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridViewBase.GroupColumnSummaryElementStyle Property

Gets or sets the style applied to individual text elements in group summary items that are aligned by columns. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public Style GroupColumnSummaryElementStyle { get; set; }

#Property Value

Type Description
Style

A Style object that is the style applied to individual text elements in group summary items that are aligned by columns.

#Remarks

The GroupColumnSummaryElementStyle property is in effect if the TableView.GroupSummaryDisplayMode property is set to GroupSummaryDisplayMode.AlignByColumns.

Use the TableView.GroupColumnSummaryContentStyle property to specify the group summary style.

#Example

The code sample below uses the GroupColumnSummaryElementStyle property to change appearance of group summary text elements. This code sample uses the DXBinding mechanism.

WPF Grid GroupColumnSummaryElementStyle

<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"/>
    </dxg:GridControl.GroupSummary>
    <dxg:GridControl.View>
        <dxg:TableView x:Name="view"
                        ShowGroupedColumns="True"
                        GroupSummaryDisplayMode="AlignByColumns"
                        GroupColumnSummaryElementStyle="{StaticResource SummaryStyle}">
        </dxg:TableView>
    </dxg:GridControl.View>
</dxg:GridControl>
See Also