FlexGrid for WinForms | ComponentOne
C1.Win.FlexGrid Namespace / C1FlexGridBase Class / Aggregate Method / Aggregate(AggregateEnum) Method
AggregateEnum value that specifies the type of aggregate to calculate.
Example

In This Topic
    Aggregate(AggregateEnum) Method
    In This Topic
    Calculates aggregate statistics for the 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 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