Class PropertyAggregateDescriptionBase
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.
Inheritance
Inherited Members
Namespace: Telerik.Pivot.Core
Assembly: Telerik.WinControls.PivotGrid.dll
Syntax
public abstract class PropertyAggregateDescriptionBase : LocalAggregateDescription, INotifyPropertyChanged, ISupportInitialize, IObservableServiceProvider, IServiceProvider, IEditable, IAggregateDescription, IDescriptionBase, INamed, ITotalFormatHost, IDescriptionsReferencing, IStringFormatableAggregate, IAggregateFunctionHost, IInitializeDescription, IDataFieldDescription
Constructors
PropertyAggregateDescriptionBase()
Declaration
protected PropertyAggregateDescriptionBase()
Properties
AggregateFunction
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.
Declaration
public AggregateFunction AggregateFunction { get; set; }
Property Value
AggregateFunction
|
DataType
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.
Declaration
protected Type DataType { get; }
Property Value
System.Type
|
IgnoreNullValues
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.
Declaration
public bool IgnoreNullValues { get; set; }
Property Value
System.Boolean
|
PropertyName
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.
Declaration
public virtual string PropertyName { get; set; }
Property Value
System.String
|
SupportedAggregateFunctions
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.
Declaration
protected virtual IEnumerable<object> SupportedAggregateFunctions { get; }
Property Value
System.Collections.Generic.IEnumerable<System.Object>
|
Methods
CloneCore(Cloneable)
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.
Declaration
protected override sealed void CloneCore(Cloneable source)
Parameters
Cloneable
source
The source aggregate description to clone from. |
Overrides
Remarks
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).
CloneOverride(Cloneable)
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.
Declaration
protected abstract void CloneOverride(Cloneable source)
Parameters
Cloneable
source
The source object to clone from. |
Remarks
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).
GetDisplayName()
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.
Declaration
protected override string GetDisplayName()
Returns
System.String
A localized display name combining the aggregate function and field name. |
Overrides
GetUniqueName()
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.
Declaration
public override string GetUniqueName()
Returns
System.String
The property name that serves as the unique identifier for this aggregate description. |
Overrides
GetValueForItem(Object)
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.
Declaration
protected override object GetValueForItem(object item)
Parameters
System.Object
item
The data item from which to extract the property value. |
Returns
System.Object
The property value extracted from the item, or null if the property is not found. |
Overrides
Exceptions
System.InvalidOperationException
Thrown when the field information has not been initialized through the Telerik.Pivot.Core.IInitializeDescription interface. |