Skip to main content

CriteriaOperator.RegisterCustomAggregate(ICustomAggregate) Method

Registers a custom aggregate function to use in any CriteriaOperator-based criteria in your application.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v24.1.dll

NuGet Package: DevExpress.Data

Declaration

public static void RegisterCustomAggregate(
    ICustomAggregate customAggregate
)

Parameters

Name Type Description
customAggregate ICustomAggregate

A custom aggregate function to register.

Remarks

To access custom aggregate functions registered via the RegisterCustomAggregate and CriteriaOperator.RegisterCustomAggregates method calls, call the CriteriaOperator.GetCustomAggregates function. To search for a specific registered custom function, call the CriteriaOperator.GetCustomAggregate function.

Note

  • The RegisterCustomAggregate method throws an exception if the customAggregate has already been registered.
  • The customAggregate must have a unique Name property value. If you use standard aggregate names (Min, Max, Sum, Avg, Single, Exists, and Count), an exception is raised.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RegisterCustomAggregate(ICustomAggregate) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also