Skip to main content
.NET 6.0+

XPBaseCollection.Count Property

Gets the number of elements contained in the XPBaseCollection instance.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

[Browsable(false)]
public int Count { get; }

Property Value

Type Description
Int32

The number of elements contained in the collection

Remarks

If the XPBaseCollection.LoadingEnabled property is set to true the collection is populated with data when the collection’s contents is accessed for the first time. So if the collection has never been accessed so far, reading the Count property will firstly load the data from a data store and then return the number of objects loaded. Note that when an XPCollection is created using a constructor with the criteriaEvaluationBehavior parameter, it is loaded immediately.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Count property.

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