Is it Possible to show summary rows for all groups,

Hi,
I have a sfdatagrid and i want to show summary rows for two groups, and when i group one column it shows summary row properly.
But when i group second column, It shows group summary for second column, But It doesn't show summary for first column.

Is this the way it should behave. Or i am missing anything.
please help

this.sfDataGrid1.GroupSummaryRows.Add(new GridSummaryRow()
            {
                Name = "tableSumamryTrue",
                ShowSummaryInRow = false,
                Title = "",
                SummaryColumns = new System.Collections.ObjectModel.ObservableCollection<Syncfusion.Data.ISummaryColumn>()
                {
                    new GridSummaryColumn()
                    {
                        Name = "TotalDRAMT",
                        SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate,
                       Format=" {Sum:#,#.00}",
                        MappingName="DEBITAMT",
                    },
                    new GridSummaryColumn()
                    {
                        Name = "TotalCRAMT",
                        SummaryType = Syncfusion.Data.SummaryType.DoubleAggregate,
                        Format=" {Sum:#,#.00}",
                        MappingName="CRADITAMT",
                    },
                }
            });


3 Replies

VS Vijayarasan Sivanandham Syncfusion Team February 12, 2020 12:51 PM UTC

Hi Mahendra, 

Thank you for contacting Syncfusion Support. 

We have analyzed your query you can create the two summary rows for two grouped column. If you need to display the summary value in first column means you have to set ShowSummaryInRow property to  true. 

this.sfDataGrid.GroupSummaryRows.Add(new GridSummaryRow() 
            {                
                ShowSummaryInRow = true, 
                Title = "Total Price : {PriceAmount}", 

                SummaryColumns = new ObservableCollection<ISummaryColumn>() 
                    { 
                        new GridSummaryColumn() 
                        { 
                            Name="OrderID", 
                            Format="{Count:d}", 
                            MappingName="OrderID", 
                            SummaryType=SummaryType.CountAggregate 
                        }, 

                        new GridSummaryColumn() 
                        { 
                            Name="CustomerID", 
                            Format="{Count:d}", 
                            MappingName="CustomerID", 
                            SummaryType=SummaryType.CountAggregate 
                        }, 

                        new GridSummaryColumn() 
                        { 
                            Name="CustomerName", 
                            Format="{Count:d}", 
                            MappingName="CustomerName", 
                            SummaryType=SummaryType.CountAggregate 
                        }, 

                        new GridSummaryColumn() 
                        { 
                            Name="ProductCount", 
                            MappingName="ProductName", 
                            SummaryType=SummaryType.CountAggregate, 
                            Format="{Count:d}" 
                        }, 

                        new GridSummaryColumn() 
                        { 
                            Name = "PriceAmount", 
                            MappingName="UnitPrice", 
                            SummaryType= SummaryType.DoubleAggregate, 
                            Format="{Sum:c}" 
                        } 
                    } 
            }); 



Please find the following image  for your reference, 


 

 
If we misunderstood your requirement, please provide more information regarding the requirement. This would help us to proceed further. 

Regards, 
Vijayarasan 



MA mahendra February 13, 2020 04:29 AM UTC

Hi
You didn't understand the requirement.
What is was asking is:
In Your given screenshot two group summary rows are shown for customerID group.
But First Group order id doesn't have group summary row.
Scenario
What if Order ID 1000 had two sub groups like ALFKI AND JOHN
According to your screenshot it will show groupsummary under both ALFKI AND JOHN.
But it wont show Summary Of All under 1000 group.

am i correct?
It seems Group Summary rows show for last group(in this case last group is customerID )
Thank You For Reply.


VS Vijayarasan Sivanandham Syncfusion Team February 13, 2020 01:42 PM UTC

Hi mahendra, 
 
Thank you for your update. 
 
We regret to tell that your requirement cannot be achieved by Sfdatagrid.GroupSummaryRow. This is our default behavior, we cannot change sfdatagrid architecture to “Draw the GroupSummaryrow parallel to the Column without indent”. 
 
Please let us know, if you need any further assistance on this. 

Regards, 
Vijayarasan 


Loader.
Up arrow icon