Back to Devexpress

XPBaseCollection.TopReturnedObjects Property

xpo-devexpress-dot-xpo-dot-xpbasecollection-368e36ac.md

latest3.8 KB
Original Source

XPBaseCollection.TopReturnedObjects Property

Gets or sets the maximum number of objects retrieved by the collection from a data store.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
[DefaultValue(0)]
public int TopReturnedObjects { get; set; }
vb
<DefaultValue(0)>
Public Property TopReturnedObjects As Integer

Property Value

TypeDefaultDescription
Int320

An integer that specifies the maximum number of objects that will be retrieved by the collection from a data store. 0 indicates that all objects which match the criteria will be retrieved.

|

Remarks

If this property’s value is greater than 0 , then the collection retrieves only the first TopReturnedObjects objects which match the collection’s XPBaseCollection.Criteria.

Note

Use the TopReturnedObjects property to adjust an XPCollection‘s object retrieval options before it’s loaded. Once a collection is loaded, changing this property has no effect. To make the changes take effect, you need to manually reload the collection. When an XPCollection is created using a constructor with the criteriaEvaluationBehavior parameter, it is loaded immediately. So, changing the TopReturnedObjects property will also have no effect.

The following code snippets (auto-collected from DevExpress Examples) contain references to the TopReturnedObjects 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.

asp-net-mvc-grid-custom-binding-and-xpo/CS/XPCustomBindingExample/XPO/XpoBindingHandlers.cs#L34

csharp
data.SkipReturnedObjects = e.StartDataRowIndex;
data.TopReturnedObjects = e.DataRowCount;
e.Data = data;

XPO_how-to-get-the-maximum-or-minimum-objects-value-from-a-collection-e468/CS/ConsoleApplication1/Program.cs#L33

csharp
);
items.TopReturnedObjects = 1;
if (items.Count != 0) {

asp-net-mvc-grid-custom-binding-and-xpo/VB/XPCustomBindingExample/XPO/XpoBindingHandlers.vb#L34

vb
data.SkipReturnedObjects = e.StartDataRowIndex
data.TopReturnedObjects = e.DataRowCount
e.Data = data

See Also

Criteria

Filter

XPBaseCollection Class

XPBaseCollection Members

DevExpress.Xpo Namespace