Skip to main content
.NET Framework 4.5.2+

XafApplication.CreateCollectionSource(IObjectSpace, Type, String) Method

Creates a collection source for a specified List View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public CollectionSourceBase CreateCollectionSource(
    IObjectSpace objectSpace,
    Type objectType,
    string listViewId
)

Parameters

Name Type Description
objectSpace IObjectSpace

An IObjectSpace object that represents an Object Space for the objects retrieved to the created collection source.

objectType Type

The Type object that represents the type of the objects that will be retrieved to the created collection source.

listViewId String

A string value representing the target List View’s identifier.

Returns

Type Description
CollectionSourceBase

A CollectionSourceBase object that represents the collection source of objects whose type is specified by the objectType parameter.

Remarks

This method creates a collection source for the View specified by the listViewID parameter. Generally, you can create it directly via the constructor of the required collection source type.

This method can be currently used only in Windows Forms applications which utilize the XtraGrid control for displaying List Views.

By default, this method is used to retrieve objects for the following List Views:

  • Lookup Property Editor’s List View;
  • List View in the pop-up Window invoked by the Link or Unlink Action.

The CollectionSourceBase.Mode property of the created CollectionSource is set to XafApplication.DefaultCollectionSourceMode property value.

See Also