Version

Retrieve the Result of a Summary

Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.

You can retrieve a SummaryResult object by indexing into a SummaryResultCollection off the SummaryRowSettings object in xamGrid.

There are different SummaryResultCollection collections available, for example the column layout or the child band collections. The one that is used depends on the value of the SummaryRowSettings/SummaryRowSettingsOverride object’s SummaryScope property.

For more information on column layouts, see the Define Column Layout topic.

The Value property of the SummaryResult object returns the result of the summary. You may need to cast the Value property to the correct data type before using it in your application logic.

The built-in summary calculators will return the following data types:

Summary Calculator * Data Type*

Sum

Decimal

Average

Decimal

Count

Integer

Minimum

Data Type of the Column

Maximum

Data Type of the Column

The SummaryDefinition of the SummaryResult object returns the Column which the summary is executed on, and the SummaryOperand of the summary.

The following example code demonstrates how to retrieve values from the SummaryResult object.

In Visual Basic:

Dim SumResult As Object = Me.MyDataGrid.SummaryRowSettings.SummaryResultCollection(0).Value
Dim SumDefinition As SummaryDefinition = Me.MyDataGrid.SummaryRowSettings.SummaryResultCollection(0).SummaryDefinition
Dim MySummary As SummaryOperandBase = SumDefinition.SummaryOperand
Dim MyColumn As String = SumDefinition.ColumnKey

In C#:

object SumResult = this.MyDataGrid.SummaryRowSettings.SummaryResultCollection[0].Value;
SummaryDefinition SumDefinition = this.MyDataGrid.SummaryRowSettings.SummaryResultCollection[0].SummaryDefinition;
SummaryOperandBase MySummary = SumDefinition.SummaryOperand;
String MyColumn = SumDefinition.ColumnKey;