Skip to main content
.NET 6.0+

XPBaseCollection.Reload() Method

Clears the collection and marks it to be reloaded with data from the data store.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public virtual void Reload()

Remarks

An XPCollection is not loaded with data immediately after it has been created. Data is loaded on demand: when the collection’s contents is accessed. The Reload method clears the collection, but doesn’t force it to reload immediately. The collection will be populated with data only when its contents are accessed.

If the Optimistic Locking is disabled, the Session does not refresh properties of previously loaded objects. The Session never refreshes properties of modified objects.

Note

When an XPCollection is created using a constructor with the criteriaEvaluationBehavior parameter, it is loaded immediately and its XPBaseCollection.LoadingEnabled property is automatically set to false. After that, the collection cannot be reloaded using the Reload method, since object loading is disabled. Calling this method only clears the collection.

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