FlexGrid for WinForms
Aggregate(AggregateEnum) Method
Example 



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
'Usage
 
Dim instance As C1FlexGridBase
Dim aggType As AggregateEnum
Dim value As Double
 
value = instance.Aggregate(aggType)
public double Aggregate( 
   AggregateEnum aggType
)
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));
}
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

C1FlexGridBase Class
C1FlexGridBase Members
Overload List

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback