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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grouping grid - Summary column

Thread ID:

Created:

Updated:

Platform:

Replies:

98757 Mar 28,2011 02:59 AM UTC Apr 1,2011 06:44 AM UTC WinForms 1
loading
Tags: GridControl
Mike Rissen
Asked On March 28, 2011 02:59 AM UTC

7.4.0.20 Windows vs2008 c#

I have a grid (as an example)
Column B = a potential Value
Column C = Percentage based on performance
Column D = B * C

These values are figured in code and the grid just simply shows what is already figured out.

In the summary, it is slightly different
Column B just needs to be sum the total values.
Column D needs to be summed too.

These two columns work.

Column C summary should be a division
"Column D summaray" / "Column B summary"

How can I accomplish this?

Here's some sample data:
20000 0.86 17200
300000 0.72 216000

Summary should be this:
320000 0.72875 233200




Jisha Joy [Syncfusion]
Replied On April 1, 2011 06:44 AM UTC

Hi Mike,

Thank you for using Syncfusion products.


You need to handle the QueryCellStyleInfo event to achieve the desired behavior.

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{

if (e.TableCellIdentity.TableCellType == GridTableCellType.SummaryEmptyCell && e.TableCellIdentity.ColIndex==5)
{
double d;
double d1;
string s1 = GridEngine.GetSummaryText(this.gridGroupingControl1.Table.TopLevelGroup, sum1);
string s2 = GridEngine.GetSummaryText(this.gridGroupingControl1.Table.TopLevelGroup, sum2);
double.TryParse(s1, out d);
double.TryParse(s2, out d1);
e.Style.Text = Convert.ToString((d /d1));
}
}

Please refer to the attached sample.

Regards,
Jisha






GGCSummaryAndExpression_c56cc9e8.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;