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

Perform operations on columns using GridSummaryRowDescriptor

I'm summarizing a grid with 5 columns. For most columns, I simply take the sum of the values for that particular column. But there are some columns that need division operations for the summary. To illustrate:
Column 1- summary of column 1
Column 2 - summary of column 2
Column 3 - Summary of column 1/ summary of column 2
Column 4 - Summary of Column 4
Column 5 - ((Summary of Column 1 *4 ) + Summary of Column 2)/ 100

It's simple enough to format the sum of each column, but how do you format the summary row of column 3 and column 5? (Both Column 3 and 5 should come out in 2 decimal places e.g. .05)

I am using this syntax for column 1, 2 and 4:
Dim sd1 As GridSummaryRowDescriptor = New GridSummaryRowDescriptor(.Name, Syncfusion.Grouping.SummaryType.Int32Aggregate, .Name, "{Sum:#,##0}")

gsr.SummaryColumns.Add(sd1)

1 Reply

LS Lingaraj S Syncfusion Team June 9, 2009 11:46 AM UTC

Hi Karver,

Thank you for your interest in Syncfusion product.

If you want to calculate the summary row value depends on the another summary column value. It can be achieved through some workaround with QueryCellStyleInfo event. Please try using the TableCellIdentity.SummaryColumn and VisibleColumns property in QueryCellStyleInfo event to achieve this behavior. The Summary Column used to placed the calculated value into summary cells.

Refer the sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/GGCSummary/main.htm

This sample demonstrate your requirements with GridGroupingControl summaries.

Let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon