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?
ADAdministrator Syncfusion Team August 4, 2004 11:54 AM UTC
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);
double val = Convert.ToDouble(obj);
return new TotalSummary(val);
ADAdministrator Syncfusion Team August 6, 2004 06:00 AM UTC
Implemented this and it does exactly what I need.
MSMohammed SharikhMarch 22, 2006 09:30 AM UTC
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..
>Implemented this and it does exactly what I need.
ADAdministrator Syncfusion Team March 23, 2006 05:55 AM UTC
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.