New to Telerik UI for WinUI? Download free 30-day trial


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 use Caption to display text in the UI when the AggregatesTemplate is set.
  • Format—Defines the string format that will be applied over the aggregated value.

To display the aggregates, set the AggregatesTemplate property of the DataGrid column that will display the value. The data context in the template is a collection of AggregateResult objects. Each AggregateResult contains the Caption of the aggregate, the aggregated value, and the value with the applied Format.

The following example shows how to add a PropertyAggregateDescriptor to the DataGrid. It will take the values from the Value property of the row model and the result will be the Sum value. You can get the aggregate values by using the GetAggregateValue and GetAggregateValues methods of the IDataView interface.

<telerikGrid:RadDataGrid ItemsSource="{Binding Items}" AutoGenerateColumns="False"> 
        <telerikGrid:DataGridTextColumn PropertyName="Value"> 
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> 
                        <TextBlock Text="{Binding [0].Caption}" /> 
                        <TextBlock Text="{Binding [0].FormattedValue}" Margin="5 0 0 0" /> 
        <telerikData:PropertyAggregateDescriptor PropertyName="Value" Function="Sum" Caption = "Total: " Format = "C" /> 
The previous example uses the following namespaces:

DataGrid with a Defined PropertyAggregateDescriptor

In this article
Not finding the help you need?