Back to Devexpress

PropertyCollectionSource Class

expressappframework-devexpress-dot-expressapp-ada78f71.md

latest6.3 KB
Original Source

PropertyCollectionSource Class

Serves as the data source for the nested List Views that display collection properties.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public class PropertyCollectionSource :
    CollectionSourceBase
vb
Public Class PropertyCollectionSource
    Inherits CollectionSourceBase

The following members return PropertyCollectionSource objects:

Remarks

When an object is displayed in a Detail View, its collection properties are displayed via nested List Views. All the nested List Views that display collection properties, by default, use instances of the PropertyCollectionSource as data sources.

The PropertyCollectionSource introduces new members as compared to the CollectionSourceBase class. These members provide information on the object whose collection property the Collection Source represents. The following table lists them.

NameDescription
PropertyCollectionSource.MasterObjectProvides access to the object, whose collection property is represented by the PropertyCollectionSource.
PropertyCollectionSource.MasterObjectTypeReturns the type of the object whose collection property is represented by the PropertyCollectionSource.
PropertyCollectionSource.DeclaredTypeReturns the type in which the collection property represented by the PropertyCollectionSource is declared.
PropertyCollectionSource.MemberInfoProvides access to the IMemberInfo object that contains metadata information on the collection property represented by the PropertyCollectionSource.

To create a PropertyCollectionSource instance, use the XafApplication.CreatePropertyCollectionSource method. There are several overloads of this method. If you use the one that does not include a dataAccessMode parameter, a value of the Application Model’s IModelListView.DataAccessMode property will be used to initialize the CollectionSourceBase.DataAccessMode property of the created collection source. Otherwise, use the overload with the dataAccessMode parameter. In this instance, the DataAccessMode property value from the Application Model will be ignored. By default, nested collections are created in Client mode, because their IModelListView.DataAccessMode property in the Application Model is set to Client.

Note

If you want to create a Collection Source for a nested List View in Server, ServerView, InstantFeedback, or InstantFeedbackView 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.

Inheritance

Object CollectionSourceBase PropertyCollectionSource LookupEditPropertyCollectionSource

See Also

PropertyCollectionSource Members

How to: Access Nested List View or Master Detail View Environment (ASP.NET Core Blazor and Windows Forms)

DevExpress.ExpressApp Namespace