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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Getting a summary value

Thread ID:





49480 Sep 20,2006 02:25 AM UTC Feb 2,2007 08:26 PM UTC WinForms 3
Tags: Grouping
Michael Lorenz
Asked On September 20, 2006 02:25 AM UTC

Hi again,

I have another GridGroupingControl question, for the same screen as last time.

I want the progress bar in the account targets groupbox to reflect a value based on the sums for the actual % and target % columns in the detail. So, in the given screenshot, I want to be able to calculate ( 0 + 0 ) / ( 5.33 + 10.66 ) = 0. My thought was to create a summary row and set its visibility to false, since I don''t actually want to display that summary. Then, in TableControl_CurrentCellAcceptedChanges (since I only need to update if a value has changed) I want to grab the two sums, calculate my new value, and set the other progress bar to that calculation.

Does this seem like a valid approach? If so, how can I access the two summary values to perform the calculation?



Administrator [Syncfusion]
Replied On September 20, 2006 07:18 AM UTC

Hi Michael,

You can use the GetSummaries method to get the summary value at the specified Table. Below is a code snippet.

//For MainTable.
GridTable table = this.grid.Table;

//For AnyTable...
GridTable table= this.grid.GetTable("TableName");

int indexofSummaryColumn = 0;

Int32AggregateSummary summary1 = (Int32AggregateSummary) table.GetSummaries()[indexofSummaryColumn];
if(summary1 != null)
Console.WriteLine("Sum : " summary1.Sum + "::: Min " + summary1.Minimum + "::: Max " + summary1.Maximum);

Let me know if this helps.


Administrator [Syncfusion]
Replied On February 2, 2007 03:34 PM UTC

Here how come i come to know that which level group summary i am getting...

I want summary cell value for the group level 2...
I have the group object. Using this group object can i get the summary value?

Administrator [Syncfusion]
Replied On February 2, 2007 08:26 PM UTC


Thank you for being patience.

The GroupLevel property can be used to check for the level of the group summary. The Summaries for the group can be retrieved by using GetSummaries method. Please refer to the following code snippet for more details.

// QueryCellStyleInfo event
Group g = el.ParentGroup;

ITreeTableSummary[] summaries = g.GetSummaries(g.ParentTable);
SummaryDescriptorCollection sdc = e.TableCellIdentity.Table.TableDescriptor.Summaries;
Int index = sdc.IndexOf(sdc["priceSummary"]);
DoubleAggregateSummary summaryPrice = summaries[index] as DoubleAggregateSummary;

index = sdc.IndexOf(sdc["volumeSummary"]);
Int32AggregateSummary summaryVolume = summaries[index] as Int32AggregateSummary;

string text = indentString + "groupedBy: " + g.CategoryKeys[0].ToString();
text += string.Format(" high:{0:F2} low:{1:F2} volume:{2:F0}", summaryPrice.Maximum, summaryPrice.Minimum, summaryVolume.Sum) + Environment.NewLine;

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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