This is a migrated thread and some comments may be shown as answers.

GridView Aggregate Function Problem

0 Answers 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 12 Mar 2013, 09:22 PM

 

Company | Customer | Invoices

ABC | Rick | In1

ABC | Rick | In2

ABC | Rick | In3

ABC | Chris | In4

ABC | Chris | In5

CBS | Dan | In6

From the data above, if I were to group on the first 2 columns above, I would expect to see

ABC Count:2 (# of customers in company ABC)

--->Rick Count: 3 (# of invoices for customer Rick in company ABC)

--->--->Inv1

--->--->Inv2

--->--->Inv3

--->Chris Count: 2 (# of invoices for customer Chris in company ABC)

--->--->Inv4

--->--->Inv5

CBS Count: 1 (# of customers in company CBS)

--->Dan Count: 1 (# of invoices for customer Dan in company CBS)

--->--->Inv6

Instead, I am seeing that all counts are the number of invoices within the company

ABC Count:6

--->Rick Count: 6

--->--->Inv1

--->--->Inv2

--->--->Inv3

--->Chris Count: 6

ect.

Here's my xaml for the group descriptors and the group header template:

<telerik:RadGridView.GroupHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<telerik:RadButton x:Name="btnSave" Click="btnSave_Click" Tag="{Binding Group}">
<StackPanel Orientation="Vertical">
<Image Source="../images/save.jpg" Height="30" Width="30" HorizontalAlignment="Center"/>
<TextBlock TextAlignment="Center" TextWrapping="Wrap">Update</TextBlock>
</StackPanel>
</telerik:RadButton>
<TextBlock Text="{Binding Group.Key}" FontSize="14" FontWeight="Bold" TextWrapping="Wrap" VerticalAlignment="Center" Padding="5" />
</StackPanel>
</DataTemplate>
</telerik:RadGridView.GroupHeaderTemplate>

<telerik:RadGridView.GroupDescriptors>
<telerik:GroupDescriptor Member="Company">
<telerik:GroupDescriptor.AggregateFunctions>
<telerik:CountFunction Caption="Count:"/>
</telerik:GroupDescriptor.AggregateFunctions>
</telerik:GroupDescriptor>
<telerik:GroupDescriptor Member="Customer">
<telerik:GroupDescriptor.AggregateFunctions>
<telerik:CountFunction Caption="Count:"/>
</telerik:GroupDescriptor.AggregateFunctions>
</telerik:GroupDescriptor>
</telerik:RadGridView.GroupDescriptors>

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Rick
Top achievements
Rank 1
Share this question
or