We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Datagrid Grouping with GroupCaption, ItemCount and Sum

Hello there i m trying ti achive a cenario, where i can have grouping in datagrid by 2 leves, First by countr, then by Brand, and in the grooup line of the grid, i want to show the groupName, and the item count and a item sum of oone particular field. 
like:
"Group key name - Count(item) - Sum(item.field)" 

After trying diffrent methods i don0t see how to achive this in correct way: 

I tryed using the CaptionSummaryRow like this, but this doesn0t let me show the group key , so i don't know what it's the group i am expandin, this only shows the total or the sum:

<syncfusion:SfDataGrid.CaptionSummaryRow>
                    <syncfusion:GridSummaryRow Name="totalSummary"  ShowSummaryInRow="True"  Title="{} {TotalCountSummary} - {TotalSumSummary}">
                        <syncfusion:GridSummaryRow.SummaryColumns>
                            <syncfusion:GridSummaryColumn
                                                      Name="TotalCountSummary"
                                                      Format="Garrafas:  '{Count:d}'"
                                                      MappingName="Price"
                                                      SummaryType="CountAggregate"
                                                    />

                            <syncfusion:GridSummaryColumn
                                                      Name="TotalSumSummary"
                                                      Format="Valor:  '{Sum:c}'"
                                                      MappingName="Price"
                                                      SummaryType="DoubleAggregate"
                                                    />
                        </syncfusion:GridSummaryRow.SummaryColumns>
                    </syncfusion:GridSummaryRow>
                </syncfusion:SfDataGrid.CaptionSummaryRow>

My second aproach  was following a post: in the forum and trying to create a custom style with converter like so: 


But this doesnt work whe  group using 2 fields :/

any tips on how i can achive this?! 

thanks
Regards


1 Reply

RA Riyaj Ahamed I Syncfusion Team December 20, 2013 12:00 PM UTC

Hi Michel,

 

Thanks for contacting Syncfustion support.

 

We have prepared a sample to meet your requirement and the sample can be downloaded from the following location.

 

Sample: SfGrid.zip

 

Please let us know if this helps.

 

Regards,

Riyaj Ahamed I


Loader.
Live Chat Icon For mobile
Up arrow icon