Changing the Default Aggregate Function
Environment
Product Version | 2018.3.913 |
Product | RadPivotGrid for WinForms |
Description
An example demonstrating how the default aggregate function of a node dragged in the RadPivodFieldList control to the aggregate descriptions area can be changed.
Solution
The data provider used in RadPivotGrid exposes the PrepareDescriptionForField event. The event arguments provide access to the aggregate description and its function.
Not all aggregate functions are suitable for all of the fields and this depends on their type. For example, applying the Average function to a string field this will cause an error.
The example demonstrates how the event can be handled by also performing an additional check for the data type of the field.
Figure 1: Default Aggregate Function