Telerik GridView For WPF Group Aggregate Columns

时间:2014-12-11 07:02:09

标签: wpf xaml telerik radgridview

我正在尝试并且未能显示与列标题对齐的组总计。通过设置以下属性ShowGroupHeaderColumnAggregates和ShowHeaderAggregates,你应该可以在这里Telerik Grouping Documentation

enter image description here

这是我正在使用的XAML - 我做错了什么或者它不起作用?财产制定者似乎没有效果。

<Window x:Class="GridViewTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525"
    xmlns:t="http://schemas.telerik.com/2008/xaml/presentation">
<Window.Resources>
    <Style TargetType="t:GroupHeaderRow">
        <Setter Property="ShowGroupHeaderColumnAggregates" Value="True" />
        <Setter Property="ShowHeaderAggregates" Value="False" />
    </Style>
</Window.Resources>
<Grid>
    <t:RadGridView ItemsSource="{Binding Path=Records}" SelectionMode="Extended">
        <t:RadGridView.GroupDescriptors>
            <t:GroupDescriptor Member="Column1" SortDirection="Ascending">
                <t:GroupDescriptor.AggregateFunctions>
                    <t:CountFunction Caption="Entries count: " />
                    <t:FirstFunction Caption="First entry: " />
                </t:GroupDescriptor.AggregateFunctions>
            </t:GroupDescriptor>
        </t:RadGridView.GroupDescriptors>
    </t:RadGridView>
</Grid>

1 个答案:

答案 0 :(得分:0)

尝试设置RadGridView GroupRenderMode = Flat