The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator Syncfusion Team 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
ADAdministrator Syncfusion Team August 6, 2004 06:00 AM UTC
Hi Stefan,
Implemented this and it does exactly what I need.
Many thanks,
Ben.
MSMohammed SharikhMarch 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.
ADAdministrator Syncfusion Team 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.