Grouping aggregates not returning correct counts

2 posts, 0 answers
  1. Rick Hodder
    Rick Hodder avatar
    17 posts
    Member since:
    Jul 2004

    Posted 15 Feb 2013 Link to this post

    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>

     

  2. Rick Hodder
    Rick Hodder avatar
    17 posts
    Member since:
    Jul 2004

    Posted 25 Feb 2013 Link to this post

    Can anyone answer this
  3. DevCraft banner
Back to Top