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

Summary Row in GridGroupingControl

Thread ID:





34028 Aug 31,2005 01:55 PM UTC Aug 31,2005 07:34 PM UTC WinForms 4
Tags: GridControl
Asked On August 31, 2005 01:55 PM UTC

I have a GGC whose datasource is based on 3 nested tables, "Employees", "Orders" and "Details". In the grid, following, or at the beginning of each Employee, I''d like to show a summary row that sums up the values of a column ("Hours") in all the Details rows for that employee. One problem is that the column ("Hours") to be summed is an unbound field which is computed in a handler for QueryValue. I have looked at the SummaryInCaption sample, but it is based on a "flat" table, rather than nested tables, and I cannot figure out how to accomplish what I need to do. Thanks, Van Baker

Administrator [Syncfusion]
Replied On August 31, 2005 03:58 PM UTC

I was working on a sample, but came to realize I was not clear on what you wanted. How are things setup? The 3 tables are related tables with Employees being the parent, Orders being the child and Details being the grandchild. Or, are Employess, Orders and Details all sibling tables on teh same level? Which table has the unbound Hours column in it? Are you grouping anything?

Replied On August 31, 2005 04:20 PM UTC

Employees is the Parent, Orders the child and Details the grandchild. I added two Relations to a DataSet to establish these relationships using primary/foreign keys EmployeeID to relate Employees and Orders, and OrderID to relate Details and Orders. I specified the DataSet to be the grid''s DataSource and "Employees" to be the DataMember. The unbound Hours column is in the grandchild table, "Details" and its value is computed based on two other column values in the same Details row. I did not intend to group anything explicitly using the grid, since it is my understanding that the table relationships will automatically group child items under their parents, which is what I want. Thanks, Van Baker

Administrator [Syncfusion]
Replied On August 31, 2005 05:46 PM UTC

Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GGC_NestedCaptionSummary_14df69e0.zip It adds an unbound column, Hours, at each level. It also add a summary row to both the GrandChild and Child tables. On the GrandChild level, the Hours values are just some random numbers. The summary row added to the GrandChild sums up the hours column. On the Child level, the unbound column is populated using the summary results from the GrandChild table. The summaryrow added to the Child table sums up the hours column in the Child. Finally, the unbound column in the parent is populated from the summaryrow in the Child. I think this is what you described. You would be free to hide the summaryrows / unbound columns in some or all the tables.

Replied On August 31, 2005 07:34 PM UTC

Hi Clay, This is absolutely perfect! A simple yet very elegant solution. Thanks so much, Van Baker


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