Hi,
Is it possible to show group summary row when the group is collapsed?
Thanks in advance
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.
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.
Will you be adding this feature anytime soon?
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.
Thanks
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.
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
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.
Hi,
This is helpful. However, is it possible to add the total of multiple columns in the caption summary?
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.
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.
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.
Hi, its working perfectly now! Thanks!
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.