The requested page is not available for the requested platform. You are viewing the content for Default platform.

CollectionSource Class

The Collection Source used by default for the List Views that display collections of business objects.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.1.dll

Declaration

public class CollectionSource :
    CollectionSourceBase
Public Class CollectionSource
    Inherits CollectionSourceBase

Remarks

The CollectionSource is used by the root (see View.IsRoot) List Views. Generally, you can expect a List View to use the CollectionSource in the following cases:

By default, a CollectionSource instance is created in Client mode. But you can set a DataView, Server or InstantFeedback mode (see CollectionSourceBase.DataAccessMode) using the Application Model. In the Model Editor, navigate to the List View node representing the target View and set the IModelListView.DataAccessMode property to one of the CollectionSourceDataAccessMode enumeration values.

Note

If you want to create a Collection Source for a nested List View in Server mode, make sure that there is no logic for sorting, filtering or something else in the collection's getter, and there are no subscribers to the collection's events. This logic and subscribers won't be taken into account, because a standalone server collection will be created instead of the original one.

XAF automatically creates and manipulates a Collection Source when it creates a List View. However, there are few typical tasks that require you to instantiate or access a Collection Source manually. Here they are:

  • Create a custom List View. To be able to do it, you need to first create the required collection source.
  • Filter a collection of objects that a List View displays on the data source level. To do this, you need to access the List View's Collection Source (see Criteria Property of a List View's Collection Source).

Inheritance

Object
CollectionSourceBase
CollectionSource
See Also