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

BaseObjectSpace.SetPrefetchPropertyNames(Object, String[]) Method

Loads specified delayed properties and child collections in each object of a given list.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public virtual void SetPrefetchPropertyNames(
    object collection,
    params string[] propertyNames
)

#Parameters

Name Type Description
collection Object

An IEnumerable list of parent objects.

propertyNames String[]

Properties to load.

#Remarks

Before a ListView is displayed, it may actively read properties of underlying data source items to calculate Conditional Appearance rules, actions’ TargetObjectsCriteria, or client-side filters. If filter conditions and appearance rules use Delayed Properties, call the SetPrefetchPropertyNames method before the ListView is opened to pre-load delayed properties and reduce a number of requiests to an underlying data source.

using DevExpress.ExpressApp;
// ...
public class PreFetchOrdersViewController : ObjectViewController<ListView, Customer> {
    protected override void OnActivated() {
        if(View.CollectionSource.DataAccessMode == CollectionSourceDataAccessMode.Client) {
            ((BaseObjectSpace)ObjectSpace).SetPrefetchPropertyNames(View.CollectionSource.Collection, nameof(Customer.Orders));
        }
    }
}
See Also