Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RuleRangeAttribute.TargetCollectionAggregate Property

Specifies the aggregate function to be checked by the current rule.

Namespace: DevExpress.Persistent.Validation

Assembly: DevExpress.Persistent.Base.v24.2.dll

#Declaration

public Aggregate TargetCollectionAggregate { get; set; }

#Property Value

Type Description
Aggregate

A Devexpress.Data.Filtering.Aggregate enumeration value which specifies the aggregate function to be checked by the current rule.

Available values:

Name Description
Exists

Determines whether the object exists in the collection.

Count

Returns the number of objects in the collection.

Max

Returns the maximum expression value in the collection.

Min

Returns the minimum expression value in the collection.

Avg

Evaluates the average of the values in the collection.

Sum

Returns the sum of all the expression values in the collection.

Single

Returns a single object from the collection. The collection must contain no more than one object.

Custom

Returns a custom aggregate function‘s result.

#Remarks

When applied to collection properties, the RuleRange can use aggregate functions. When a value is assigned to the TargetCollectionAggregate property, the validation rule does not check the collection property’s elements. Instead, it checks the specified aggregate function.

See Also