PropertyAggregateDescriptor
The PropertyAggregateDescriptor allows you to define a property and a function that are applied over the property values of the DataGrid, which accumulates an aggregated result based on the component data.
To set up the PropertyAggregateDescriptor, use the following properties:
-
PropertyName—Defines the name of the property that is used to compute the aggregate value. -
Function—Defines a KnownFunction value that will be applied to the aggregate. -
Caption—Defines the caption of the aggregate. You can useCaptionto display text in the UI. -
Format—Defines the string format that will be applied over the aggregated value.
The PropertyAggregateDescriptor supports the following KnownFunction aggregates:
-
Sum- TheSumfunction sumarizes all values in the column. -
Min- TheMinimumvalue of the cells in the column. -
Max- TheMaximumvalue of the cells in the column. -
Average- TheAveragevalue of the cells in the column. -
Count- TheCOUNTfunction counts the items in the column. -
Product- ThePRODUCTfunction multiplies all the numbers given as arguments and returns the product. -
StdDev- TheStandard Deviationis a measure of how widely values are dispersed from the average value, based on a sample function. -
StdDevP- TheStandard Deviationis a measure of how widely values are dispersed from the average value, based on the entire population function. -
Var- TheVarianceis a measure of dispersion, based on a sample function. -
VarP- TheVarianceis a measure of dispersion, based on the entire population function.
The following example shows how to add a PropertyAggregateDescriptor to the DataGrid's Columns.
<telerikDataGrid:DataGridNumericalColumn PropertyName="StadiumCapacity"
HeaderText="Stadium Capacity">
<telerikDataGrid:DataGridNumericalColumn.AggregateDescriptors>
<telerikCommon:PropertyAggregateDescriptor PropertyName="Price"
Function="Min"
Format="C"
Caption=" " />
<telerikCommon:PropertyAggregateDescriptor PropertyName="Price"
Function="Max"
Format="C"
Caption=" " />
</telerikDataGrid:DataGridNumericalColumn.AggregateDescriptors>
</telerikDataGrid:DataGridNumericalColumn>
And the namespaces used:
xmlns:telerikDataGrid="clr-namespace:Telerik.XamarinForms.DataGrid;assembly=Telerik.XamarinForms.DataGrid"
xmlns:telerikCommon="clr-namespace:Telerik.XamarinForms.Common.Data;assembly=Telerik.XamarinForms.Common"