[]
        
(Showing Draft Content)

C1.Win.C1FlexGrid.C1FlexGridBase.Aggregate

Aggregate Method

Aggregate(AggregateEnum, CellRange, AggregateFlags)

Calculates aggregate statistics for a range.

Declaration
public double Aggregate(AggregateEnum aggType, CellRange rg, AggregateFlags flags)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

CellRange rg

CellRange object that contains the values to be aggregated.

AggregateFlags flags

AggregateFlags value that specifies aggregation options.

Returns
Type Description
double

A double that represents the aggregate value.

Aggregate(AggregateEnum, int, int, int, int, AggregateFlags)

Calculates aggregate statistics for a range.

Declaration
public double Aggregate(AggregateEnum aggType, int topRow, int leftCol, int bottomRow, int rightCol, AggregateFlags flags)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

int topRow

Top row in the range.

int leftCol

Left column in the range.

int bottomRow

Bottom row in the range.

int rightCol

Right column in the range.

AggregateFlags flags

AggregateFlags value that specifies aggregation options.

Returns
Type Description
double

A double that represents the aggregate value.

Aggregate(AggregateEnum, AggregateFlags)

Calculates aggregate statistics for the selection.

Declaration
public double Aggregate(AggregateEnum aggType, AggregateFlags flags)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

AggregateFlags flags

AggregateFlags value that specifies aggregation options.

Returns
Type Description
double

A double that represents the aggregate value.

Aggregate(AggregateEnum)

Calculates aggregate statistics for the selection.

Declaration
public double Aggregate(AggregateEnum aggType)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

Returns
Type Description
double

A double that represents the aggregate value.

Examples

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));
}

Aggregate(AggregateEnum, CellRange)

Calculates aggregate statistics for a range.

Declaration
public double Aggregate(AggregateEnum aggType, CellRange rg)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

CellRange rg

CellRange object that contains the values to be aggregated.

Returns
Type Description
double

A double that represents the aggregate value.

Aggregate(AggregateEnum, int, int, int, int)

Calculates aggregate statistics for a range.

Declaration
public double Aggregate(AggregateEnum aggType, int topRow, int leftCol, int bottomRow, int rightCol)
Parameters
Type Name Description
AggregateEnum aggType

AggregateEnum value that specifies the type of aggregate to calculate.

int topRow

Top row in the range.

int leftCol

Left column in the range.

int bottomRow

Bottom row in the range.

int rightCol

Right column in the range.

Returns
Type Description
double

A double that represents the aggregate value.