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.

Using Multiple Columns in Custom Summaries in GridGrouping Control

Thread ID:





17230 Aug 4,2004 03:17 AM Mar 23,2006 12:55 AM Windows Forms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On August 4, 2004 03:17 AM

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 07:54 AM

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 02:00 AM

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

Mohammed Sharikh
Replied On March 22, 2006 04:30 AM

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 12:55 AM

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.

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.