Provides a base class for aggregate descriptions that perform calculations on object properties in pivot operations. This abstract class defines property-based aggregation with support for various aggregate functions, null value handling, and automatic function selection based on data types and calculated items.
Definition
Namespace:Telerik.Pivot.Core
Assembly:Telerik.WinControls.PivotGrid.dll
Syntax:
[DataContract]
public abstract class PropertyAggregateDescriptionBase : LocalAggregateDescription, INotifyPropertyChanged, ISupportInitialize, IServiceProvider, IEditable, IAggregateDescription, IDescriptionBase, INamed
Inheritance: objectCloneableSettingsNodeDescriptionBaseAggregateDescriptionBaseLocalAggregateDescriptionPropertyAggregateDescriptionBase...
Derived Classes:
Implements:
Inherited Members
Constructors
protected PropertyAggregateDescriptionBase()
Properties
Gets or sets the AggregateFunction used for calculating summary values. This function determines how property values are combined to produce aggregate results such as Sum, Average, Count, etc. Defaults to SumAggregateFunction if not explicitly set.
[DataMember]
public AggregateFunction AggregateFunction { get; set; }
Gets the data type of the property being aggregated. This type information is used to determine appropriate aggregate functions and value processing logic. Returns null if field information has not been initialized.
protected Type DataType { get; }
Gets or sets a value indicating whether the AggregateFunction should ignore null values when calculating aggregate results. When true, null values are excluded from calculations; when false, null values may affect the final result depending on the aggregate function behavior.
[DataMember]
public bool IgnoreNullValues { get; set; }
Gets or sets the name of the property used for aggregation calculations. This property identifies which field from the data objects should be used to extract values for aggregation.
[DataMember]
public virtual string PropertyName { get; set; }
SupportedAggregateFunctions
IEnumerable<object>
Gets the collection of aggregate functions that are suitable for this property type. The available functions depend on the data type and whether calculated items exist in group descriptions. Numeric types support mathematical functions while non-numeric types typically support Count only.
protected virtual IEnumerable<object> SupportedAggregateFunctions { get; }
Methods
Creates a deep copy of this aggregate description by copying core properties and delegating type-specific cloning to derived classes. This method handles property name, aggregate function, and null value handling settings, then calls CloneOverride(Cloneable) for derived class implementation.
protected override sealed void CloneCore(Cloneable source)
The source aggregate description to clone from.
Overrides:
Notes to Inheritors If you derive from Cloneable, you may need to override this method to copy all properties. It is essential that all implementations call the base implementation of this method (if you don't call base you should manually copy all needed properties including base properties).
When overridden in derived classes, performs type-specific cloning operations for the derived class properties. This method is called by CloneCore(Cloneable) after base properties have been copied.
protected abstract void CloneOverride(Cloneable source)
The source object to clone from.
Notes to Inheritors: If you derive from Cloneable, you need to override this method to copy all properties. It is essential that all implementations call the base implementation of this method (if you don't call base you should manually copy all needed properties including base properties).
Gets the display name for this aggregate description by combining the aggregate function name with the field name. The display name is localized and follows the format "Function of FieldName" (e.g., "Sum of Price"). Uses the field's display name if available, otherwise falls back to the property name.
protected override string GetDisplayName()
A localized display name combining the aggregate function and field name.
Overrides:
Gets the unique name for this aggregate description, which is the property name used for aggregation. This unique name is used to identify and distinguish this aggregate description from others.
public override string GetUniqueName()
The property name that serves as the unique identifier for this aggregate description.
Overrides:
Extracts the property value from the specified item for aggregation calculations. This method uses the configured property name to retrieve the value that will be passed to the aggregate function.
protected override object GetValueForItem(object item)
The data item from which to extract the property value.
Returns:The property value extracted from the item, or null if the property is not found.
Exceptions:Thrown when the field information has not been initialized through the IInitializeDescription interface.
Overrides: