ComponentOne FlexGrid for WinForms
Aggregate(AggregateEnum) Method
Example 

C1.Win.C1FlexGrid Namespace > C1FlexGridBase Class > Aggregate Method : Aggregate(AggregateEnum) Method
AggregateEnum value that specifies the type of aggregate to calculate.
Calculates aggregate statistics for the current selection.
Syntax
'Declaration
 
Public Overloads Function Aggregate( _
   ByVal aggType As AggregateEnum _
) As Double
public double Aggregate( 
   AggregateEnum aggType
)

Parameters

aggType
AggregateEnum value that specifies the type of aggregate to calculate.

Return Value

A System.Double that represents the aggregate value.
Example
The code below Aggregate(AggregateEnum,CellRange,AggregateFlags) method to calculate aggregate statistics for the current selection. Whenever the selection changes, new aggregates are calculated and written to the console.
void flex_SelChange(object sender, System.EventArgs e)
{
  string fmt = "Count {0:0}, Sum {1:#,##0.00}, " +
               "Avg {2:#,##0.00}, Stdev {3:#,##0.00}";
  Console.WriteLine(fmt,
    flex.Aggregate(AggregateEnum.Count),
    flex.Aggregate(AggregateEnum.Sum),
    flex.Aggregate(AggregateEnum.Average),
    flex.Aggregate(AggregateEnum.Std));
}
See Also

Reference

C1FlexGridBase Class
C1FlexGridBase Members
Overload List