Xceed Grid for WinForms v4.3 Documentation
StatFunction Property
Example 


Xceed.Grid.v4.3 Assembly > Xceed.Grid Namespace > SummaryCell Class : StatFunction Property
Gets or sets the statistical function used by the SummaryCell to calculate its value.
Syntax
'Declaration
 
<DescriptionAttribute("The statistical function used by the SummaryCell to calculate its value.")>
<CategoryAttribute("Data")>
<RefreshPropertiesAttribute(RefreshProperties.All)>
<ApplyToDesignerAttribute(True)>
Public Property StatFunction As StatFunction
'Usage
 
Dim instance As SummaryCell
Dim value As StatFunction
 
instance.StatFunction = value
 
value = instance.StatFunction
[Description("The statistical function used by the SummaryCell to calculate its value.")]
[Category("Data")]
[RefreshProperties(RefreshProperties.All)]
[ApplyToDesigner(true)]
public StatFunction StatFunction {get; set;}

Property Value

A StatFunction value representing the statistical function used by the cell to calculate its value. By default, DefaultStatFunction.
Remarks

The values are rounded in the same manner as the string.Format round, meaning a banker's round.

The statistics for a column other than the SummaryCell's parent column can be calculated and displayed in the cell by setting the StatFieldName property. The StatFieldName property indicates for which column the statistics will be calculated.

Example
The following example demonstrates how to calculate the average value of the "Quantity" column and display the result in the "UnitPrice" SummaryCell. Dim unitCell As SummaryCell = CType( sumRow.Cells( "UnitPrice" ), SummaryCell ) unitCell.StatFieldName = "Quantity" unitCell.StatFunction = StatFunction.Average unitCell.TitleFormat = "The average ordered quantity is: "
SummaryCell unitCell = ( SummaryCell )sumRow.Cells[ "UnitPrice" ];

unitCell.StatFieldName = "Quantity";
unitCell.StatFunction = StatFunction.Average;
unitCell.TitleFormat = "The average ordered quantity is: ";
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SummaryCell Class
SummaryCell Members