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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to best group and sum across a model

Thread ID:

Created:

Updated:

Platform:

Replies:

80284 Mar 26,2009 03:36 PM UTC Apr 1,2009 04:22 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 26, 2009 03:36 PM UTC

Hi -
I've been looking around for a solution to a problem for a while, perhaps syncfusion could offer that solution.

I have the following model:

OrderId User Price Quantity
101 John 7.75 100
102 Fred 8.00 150
103 John 7.75 200
104 John 8.00 125

And I'd like to create a view into this model that groups on Price & User and sums the quantities then sorts by price so the view would look like:

User Price Quantity
John 7.75 300 <-- Grouped & Summed
Fred 8.00 150
John 8.00 125

Is this possible with some of the syncfusion grouping or grid functionality?

Any thoughts about the best way to accomplish this?

Thanks - have a great morning!
Matty



Lingaraj S [Syncfusion]
Replied On March 28, 2009 07:06 AM UTC

HiMatty,

Thanks for your interest in syncfusion products.

This functionality can be achieved by adding the group summary value in group header in GridGroupingControl, please try to use CaptionText and CaptionSummaryRow property.

Please refer the sample below:
http://files.syncfusion.com/support/samples/Grid.Windows/7.1.0.30/F80284/main.htm

Let me know if it helps.

Regards,
Lingaraj S


Administrator [Syncfusion]
Replied On March 30, 2009 07:49 PM UTC

Thank you for the response.
This looks like it could be a solution to my problem - the grouping and summing is exactly what I'd like - however, is it possible to remove all of the collapsible rows and render the cells as a flat grid (just a grid with the view that I describe in my earlier request)?

Ultimately, the view shouldn't reveal the original model or any of the logic correlated with developing the view - in this case, it should just show the Name, Price, and Summed Quantity.

Thanks again for your assistance,
Matt


Administrator [Syncfusion]
Replied On March 31, 2009 04:49 PM UTC

Matty,

Yes, this is definitely possible. We will provide you an updated sample soon.

Regards,
Praveen


Administrator [Syncfusion]
Replied On April 1, 2009 04:22 PM UTC

Matty,

Here is the updated sample that does exactly what you want.

There is source code comments in the sample that should tell you how this is implemented. Let us know if you have any questions.





GroupSummary_b2093c7c.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

;