Back to Devexpress

XPBaseCollection.SkipReturnedObjects Property

xpo-devexpress-dot-xpo-dot-xpbasecollection-328cba82.md

latest3.9 KB
Original Source

XPBaseCollection.SkipReturnedObjects Property

Gets or sets the number of objects to exclude when populating the collection with objects from a data store.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

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

Property Value

TypeDefaultDescription
Int320

An integer value that specifies the number of objects to exclude when populating the collection. 0 indicates that objects are not excluded.

|

Remarks

If the property value is greater than 0 , then the collection skips the first SkipReturnedObjects objects which match the collection’s XPBaseCollection.Criteria, and retrieves the number of objects specified by the XPBaseCollection.TopReturnedObjects property. So, SkipReturnedObjects is applied before XPBaseCollection.TopReturnedObjects.

Note

Use the SkipReturnedObjects 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 SkipReturnedObjects property will also have no effect.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SkipReturnedObjects 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#L33

csharp
data.Sorting = GetSorting(e.State.SortedColumns, e.StartDataRowIndex != 0 || e.DataRowCount != 0);
data.SkipReturnedObjects = e.StartDataRowIndex;
data.TopReturnedObjects = e.DataRowCount;

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

vb
data.Sorting = GetSorting(e.State.SortedColumns, e.StartDataRowIndex <> 0 OrElse e.DataRowCount <> 0)
data.SkipReturnedObjects = e.StartDataRowIndex
data.TopReturnedObjects = e.DataRowCount

See Also

Criteria

Filter

XPBaseCollection Class

XPBaseCollection Members

DevExpress.Xpo Namespace