Skip to main content
A newer version of this page is available. .

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.v19.2.dll

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 group summary items’ style.

Example

The code sample below uses the TableView.GroupColumnSummaryContentStyle property to change the group summary items’ appearance displayed within columns. This code sample uses the DXBinding mechanism.

<Window  
    x:Class="DXSample.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"     
    xmlns:local="clr-namespace:DXSample"
    Title="MainWindow">
    <Window.DataContext>
        <local:ViewModel/>
    </Window.DataContext>
    <Grid>
        <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>
    </Grid>
</Window>

The image below illustrates the result.

WPF_Grid_GridGroupSummaryItemElementStyle

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupColumnSummaryElementStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also