Show group summary when group is collapsed

Hi,

Is it possible to show group summary row when the group is collapsed?

Thanks in advance


14 Replies 1 reply marked as answer

DM Dhanasekar Mohanraj Syncfusion Team August 1, 2022 03:24 PM UTC

Hi Farzin Hameed,

SfDataGrid does not contain
direct support to achieve your requirement of “Show group summary when the group is collapsed”. We will check the possibilities to achieve your requirement. So, we need two more business days to validate this. We will check and update further details on or before August 03, 2022.


We appreciate your patience until then.

Regards,
Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team August 3, 2022 02:23 PM UTC

Hi Farzin Hameed,

We have analyzed the feasibilities to achieve your requirement. We regret to let you know that currently, Our SfDataGrid source architecture does not provide support to achieve your requirement of “Show group summary when the group is collapsed”. Please revert us if you have any other queries.

Regards,
Dhanasekar M.



FH Farzin Hameed August 4, 2022 02:18 PM UTC

Will you be adding this feature anytime soon?



DM Dhanasekar Mohanraj Syncfusion Team August 5, 2022 02:14 PM UTC

Hi Farzin Hameed,

We regret to inform you that currently, Our SfDatagrid source architecture does not provide support to achieve your requirement of “Show group summary when the group is collapsed”. However, you can achieve your requirement by using CaptionSummary instead of GroupSummary.( By showing the required summary values as Caption Summary)

For more information related to CaptionSummary, please refer to the below user guide documentation link,

UG Link: https://help.syncfusion.com/windowsforms/datagrid/summaries#caption-summary

Please let us know if you have any concerns about this.

Regards,
Dhanasekar M.



FH Farzin Hameed August 6, 2022 05:35 AM UTC

Thanks



DM Dhanasekar Mohanraj Syncfusion Team August 8, 2022 02:02 PM UTC

Hi Farzin Hameed,

If you are satisfied with our response, please mark it as an answer. Otherwise, please let us know if you have any further queries on this. We are happy to help you.


Regards,

Dhanasekar M.



FH Farzin Hameed August 30, 2022 01:09 PM UTC

Hi,


I went through the link for caption summary. However, it would be helpful if you could guide me as to how to add group totals to the caption summary,


TIA



DM Dhanasekar Mohanraj Syncfusion Team August 31, 2022 01:22 PM UTC

Hi Farzin Hameed,

You can achieve your requirement to show the group totals to the caption summary by adding CaptionSummary with sum format shown below,

// Creates the GridSummaryRow.

GridSummaryRow captionSummaryRow = new GridSummaryRow();

captionSummaryRow.Name = "CaptionSummary";

captionSummaryRow.ShowSummaryInRow = false;

 

// Creates the GridSummaryColumn.

GridSummaryColumn summaryColumn1 = new GridSummaryColumn();

summaryColumn1.Name = "Column1";

summaryColumn1.SummaryType = SummaryType.DoubleAggregate;

summaryColumn1.Format = "Total Price : {Sum:c}";

summaryColumn1.MappingName = "UnitPrice";

 

// Adds the summary column in the SummaryColumns collection.

captionSummaryRow.SummaryColumns.Add(summaryColumn1);

 

// Initializes the caption summary row.

this.sfDataGrid1.CaptionSummaryRow = captionSummaryRow;


We have prepared the sample based on your scenario. Please find the sample in the attachment and let us know if you have any concerns about this.

Regards,
Dhanasekar M.

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Attachment: SfDataGridDeno_42ec793f.zip


FH Farzin Hameed September 8, 2022 08:17 AM UTC

Hi,


This is helpful. However, is it possible to add the total of multiple columns in the caption summary?



DM Dhanasekar Mohanraj Syncfusion Team September 9, 2022 02:05 PM UTC

Hi Farzin Hameed,


You can achieve your requirement to show the multiple columns total as CaptionSummary using below code snippet,


// Creates the GridSummaryRow.

GridSummaryRow captionSummaryRow = new GridSummaryRow();

captionSummaryRow.Name = "CaptionSummary";

captionSummaryRow.ShowSummaryInRow = false;

 

// Creates the GridSummaryColumn.

GridSummaryColumn summaryColumn1 = new GridSummaryColumn();

summaryColumn1.Name = "Column1";

summaryColumn1.SummaryType = SummaryType.DoubleAggregate;

summaryColumn1.Format = "Total Price : {Sum:c}";

summaryColumn1.MappingName = "UnitPrice";

 

// Adds the summary column in the SummaryColumns collection.

captionSummaryRow.SummaryColumns.Add(summaryColumn1);

 

// Creates another GridSummaryColumn.

GridSummaryColumn summaryColumn2 = new GridSummaryColumn();

summaryColumn2.Name = "Column2";

summaryColumn2.SummaryType = SummaryType.Int32Aggregate;

summaryColumn2.Format = "Quantity : {Sum:c}";

summaryColumn2.MappingName = "Quantity";

 

// Adds the summary column in the SummaryColumns collection.

captionSummaryRow.SummaryColumns.Add(summaryColumn2);

 

// Initializes the caption summary row.

this.sfDataGrid1.CaptionSummaryRow = captionSummaryRow;


For more information related to shown caption summary for multiple columns, please refer to the below user guide documentation link,


UG Link: https://help.syncfusion.com/windowsforms/datagrid/summaries#displaying-caption-summary-for-column

We have modified the sample based on your scenario. Please find the sample in the attachment and let us know if you have any concerns about this.


Regards,

Dhanasekar M.


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Attachment: SfDataGridDeno_9d7bc173.zip

Marked as answer

FH Farzin Hameed September 15, 2022 12:23 PM UTC

Hi,


Thanks for the help. But when I try to drag to the top and group columns, I get an error saying - ColumnName cannot be NULL.


This error does not happen when i add table summaries and group summaries, but only while adding caption summary.

I populate the datagrid using datatable as datasource.



DM Dhanasekar Mohanraj Syncfusion Team September 16, 2022 02:01 PM UTC

Hi Farzin Hameed,

We are checking the reported issue on our end. We suspect that you are trying to add the Caption summary for the column which is not present in your grid. Here we have attached the sample bound with datatable as you mentioned. Its works as expected, please have a look at this, If you still facing the reported issue please modify the attached sample based on your scenario and share the video illustration of the reported issue. It will be helpful for us to check the cause of the issue and to provide a solution at the earliest.


Regards,

Dhanasekar M.


Attachment: SfDG_DT_Demo_52b2bfed.zip


FH Farzin Hameed September 20, 2022 05:40 AM UTC

Hi, its working perfectly now! Thanks!



DM Dhanasekar Mohanraj Syncfusion Team September 21, 2022 02:10 PM UTC

Hi Farzin Hameed,


If you are satisfied with our response, please mark it as an answer. Otherwise, please let us know if you have any further queries on this. We are happy to help you.


Regards,
Dhanasekar M.


Loader.
Up arrow icon