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

Using Multiple Columns in Custom Summaries in GridGrouping Control

Thread ID:





17230 Aug 4,2004 07:17 AM UTC Mar 23,2006 05:55 AM UTC WinForms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On August 4, 2004 07:17 AM UTC

Hi, I''m trying to create a custom summary that provides a weighted average. In the ISummary:CreateSummaryMethod() of my custom summary implementation I need way of accessing a field that isn''t the field being summarized. Is it possible to do this? Thanks, Ben.

Administrator [Syncfusion]
Replied On August 4, 2004 11:54 AM UTC

Hi Ben, you can access any field (or multiple fields) from the record. See this example: public static ISummary CreateSummaryMethod(SummaryDescriptor sd, Record record) { object obj = record.ParentTableDescriptor.Fields["Weight"].GetValue(record); // -or - // you could also access values from outside the table here, e.g. a external table // of weights. You only need to make sure then that if you change values in the external table // that you then call InvalidateSummariesTopDown on the grids Table object. bool isNull = (obj == null || obj is DBNull); if (isNull) return Empty; else { double val = Convert.ToDouble(obj); return new TotalSummary(val); } } Stefan

Administrator [Syncfusion]
Replied On August 6, 2004 06:00 AM UTC

Hi Stefan, Implemented this and it does exactly what I need. Many thanks, Ben.

Mohammed Sharikh
Replied On March 22, 2006 09:30 AM UTC

Hi, Could you please post the implementation of the weighted average custom summary? I am having problems getting it to work because the docs don''t describe how to use custom summary delegates.. >Hi Stefan, > >Implemented this and it does exactly what I need. > >Many thanks, > >Ben.

Administrator [Syncfusion]
Replied On March 23, 2006 05:55 AM UTC

Hi Mohammed, I am sorry for the delay in responding. Attached is a sample that implements the Weighted Mean Custom Summary. Let us know if you have any further queries. Regards, Calvin.



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

Live Chat Icon For mobile
Live Chat Icon