[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class DataSourcePropertyAttribute :
<AttributeUsage(AttributeTargets.Property, Inherited:=True, AllowMultiple:=False)>
Public Class DataSourcePropertyAttribute
You can filter the data source for the List View displayed in a Lookup Property Editor or in the LinkUnlinkController.LinkAction Action's popup window. For this purpose, apply the DataSourceProperty attribute to the target property. Specify a collection property using the attribute's DataSourcePropertyAttribute.DataSourceProperty parameter. This collection must contain objects of the target property's type or its descendants. These objects will actually be displayed in the Lookup List View of the target property. The collection property must provide information on the element type. It can be an associated collection, a generic collection or an untyped collection decorated with the CollectionAttribute.
An independent server-mode collection is created as a data source for a lookup ListView when the IModelListView.DataAccessMode option is set to Server or InstantFeedback for that ListView model. However, when the DataSourcePropertyAttribute is applied for the lookup property, the property pointed in the attribute is used as a lookup data source, and the standalone independent server-mode collection is not created and is not used at all.
The reason is that the data source property getter contains logic calculated on the client side and the data source is populated by the client application at the moment when the lookup editor requests to display objects. So, the Server or InstantFeedback mode option and the DataSourceProperty attribute do not work simultaneously.
The values that you pass as the DataSourceProperty attribute's parameters are assigned to the corresponding properties of the Application Model's BOModel | <Class> | OwnMembers | <Member> node. Note, you can set or change values of these attributes directly in the Application Model using the Model Editor. The values that are set in the Application Model are used when constructing the application UI.
By default, the criteria which is set for a property using the DataSourceProperty attribute in a base business class remains applied in the business class descendants.
An object which is added to a lookup via the New Action is always displayed, regardless of whether or not the DataSourceProperty or DataSourceCriteria attributes are applied.