Back to Devexpress

XafApplication.DefaultCollectionSourceMode Property

expressappframework-devexpress-dot-expressapp-dot-xafapplication-6c601a91.md

latest4.0 KB
Original Source

XafApplication.DefaultCollectionSourceMode Property

Specifies the default mode of operation for Collection Sources created by the XafApplication.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[DefaultValue(CollectionSourceMode.Proxy)]
public CollectionSourceMode DefaultCollectionSourceMode { get; set; }
vb
<DefaultValue(CollectionSourceMode.Proxy)>
Public Property DefaultCollectionSourceMode As CollectionSourceMode

Property Value

TypeDefaultDescription
CollectionSourceModeProxy

A CollectionSourceMode enumeration value specifying the default mode of operation for Collection Sources. By default, the CollectionSourceMode.Proxy value is set.

|

Available values:

NameDescription
Normal

A collection of objects of the specified type is created by the CollectionSourceBase.ObjectSpace. For instance, the XPObjectSpace creates an XPCollection. When filtering is applied, the corresponding criteria is directly applied to the underlying collection. So, in this mode, if you iterate over the collection represented by a List View, you will only see the filtered objects.

| | Proxy |

Two collections are created for a Collection Source. The first one is an original collection created by the Object Space. The second one is a intermediate proxy collection. The proxy collection represents the original collection’s wrapper, because it implements several interfaces that are required in different built-in features. When filtering is applied to the collection that a Collection Source represents, the criteria are not directly applied to the original collection, instead they are applied to the proxy collection. So, in this mode, if you iterate over the collection represented by the CollectionSourceBase.Collection property, you will see only filtered objects. But you can iterate over the original collection to access all objects belonging to the collection.

|

Remarks

This property is used in the XafApplication.CreateCollectionSource and XafApplication.CreatePropertyCollectionSource methods. Note that it is overridden by the CollectionSourceModeAttribute.Mode parameter value of the CollectionSourceModeAttribute, if this attribute is applied to the collection property for whose List View a Collection Source is currently created.

For detailed information on Collection Sources, refer to the CollectionSourceBase class description.

See Also

Mode

XafApplication Class

XafApplication Members

DevExpress.ExpressApp Namespace