Group Summaries data lined up with the data columns

I added a summary row at the bottom of the groups in an SFDatagrid control. However the data in the summary row is not aligned with the data in the data columns.  In the image below I added a large number to one of the cells. The number displays correctly in the data cell but it wraps in the summary row ( bottom row where the value is 100,000). You can also see that the numbers the summary row is not right justified like the data cells are. 


Is there a configuration setting that will line up the summary data with the cell data?

Here is the code to create the summary totals

 Dim captionSummaryRow As New GridSummaryRow()
        captionSummaryRow.Name = "CaptionSummary"
        captionSummaryRow.ShowSummaryInRow = False
        captionSummaryRow.TitleColumnCount = NumMonths
        captionSummaryRow.Title = "Total"

 Dim summaryColumn1 As New GridSummaryColumn()
            summaryColumn1.Name = Header & " Hrs"
            summaryColumn1.Format = "{Sum}"
            summaryColumn1.MappingName = Header & " Hrs"
            summaryColumn1.SummaryType = SummaryType.DoubleAggregate
            captionSummaryRow.SummaryColumns.Add(summaryColumn1)

        MyDataGrid.GroupSummaryRows.Add(captionSummaryRow)


4 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team January 15, 2021 03:48 PM UTC

Hi George Busby,

Thank you for contacting Syncfusion support.

Your requirement can be achieved by setting HorizontalAlignment as Right for SummaryRowStyle in SfDataGrid.Style. Please refer
the below KB documentation for your reference,

KB Link: https://www.syncfusion.com/kb/12009/how-to-right-justify-a-table-group-and-caption-summary-column-in-winforms-datagrid 
We hope this helps. Please let us know, if you require further assistance on this.

Regards,
Vijayarasan S 


Marked as answer

GB George Busby January 16, 2021 01:01 AM UTC

That only set the first column to be right justified , It did not work on the other columns.

From the image above you can see that the word 'Total" is right justified but the "100000" in the next column and the "300" in the next column are not right justified.


GB George Busby January 16, 2021 01:19 AM UTC

I found the solution. I had to set the right padding to zero

 Dim mypadding As Padding
        mypadding.Right = 0
        SfDataGrid2.Style.GroupSummaryRowStyle.TextMargins = mypadding




VS Vijayarasan Sivanandham Syncfusion Team January 18, 2021 11:31 AM UTC

Hi George Busby, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊. 
 
Regards, 
Vijayarasan S 


Loader.
Up arrow icon