[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Collapse]API Reference
  [Expand]DevExpress.EasyTest.Framework
  [Expand]DevExpress.ExpressApp
  [Expand]DevExpress.ExpressApp.Actions
  [Expand]DevExpress.ExpressApp.AuditTrail
  [Expand]DevExpress.ExpressApp.Chart
  [Expand]DevExpress.ExpressApp.Chart.Web
  [Expand]DevExpress.ExpressApp.Chart.Win
  [Expand]DevExpress.ExpressApp.CloneObject
  [Expand]DevExpress.ExpressApp.ConditionalAppearance
  [Expand]DevExpress.ExpressApp.Dashboards
  [Expand]DevExpress.ExpressApp.Dashboards.Web
  [Expand]DevExpress.ExpressApp.Dashboards.Win
  [Expand]DevExpress.ExpressApp.Data
  [Expand]DevExpress.ExpressApp.DC
  [Expand]DevExpress.ExpressApp.DC.ClassGeneration
  [Expand]DevExpress.ExpressApp.Editors
  [Expand]DevExpress.ExpressApp.EF
  [Expand]DevExpress.ExpressApp.EF.Utils
  [Expand]DevExpress.ExpressApp.FileAttachments.Web
  [Expand]DevExpress.ExpressApp.FileAttachments.Win
  [Expand]DevExpress.ExpressApp.Filtering
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Web
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Win
  [Expand]DevExpress.ExpressApp.Kpi
  [Expand]DevExpress.ExpressApp.Layout
  [Expand]DevExpress.ExpressApp.Maps.Mobile
  [Expand]DevExpress.ExpressApp.Maps.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Maps.Web
  [Expand]DevExpress.ExpressApp.Maps.Web.Helpers
  [Expand]DevExpress.ExpressApp.MiddleTier
  [Expand]DevExpress.ExpressApp.Mobile
  [Expand]DevExpress.ExpressApp.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Mobile.MobileModel
  [Expand]DevExpress.ExpressApp.Mobile.SystemModule
  [Expand]DevExpress.ExpressApp.Mobile.Templates
  [Expand]DevExpress.ExpressApp.Model
  [Expand]DevExpress.ExpressApp.Model.Core
  [Expand]DevExpress.ExpressApp.Model.NodeGenerators
  [Expand]DevExpress.ExpressApp.ModelEditor
  [Expand]DevExpress.ExpressApp.Notifications
  [Expand]DevExpress.ExpressApp.Notifications.Web
  [Expand]DevExpress.ExpressApp.Notifications.Win
  [Expand]DevExpress.ExpressApp.Office.Win
  [Expand]DevExpress.ExpressApp.PivotChart
  [Expand]DevExpress.ExpressApp.PivotChart.Web
  [Expand]DevExpress.ExpressApp.PivotChart.Win
  [Expand]DevExpress.ExpressApp.PivotGrid
  [Expand]DevExpress.ExpressApp.PivotGrid.Web
  [Expand]DevExpress.ExpressApp.PivotGrid.Win
  [Expand]DevExpress.ExpressApp.Reports
  [Expand]DevExpress.ExpressApp.Reports.Web
  [Expand]DevExpress.ExpressApp.Reports.Win
  [Expand]DevExpress.ExpressApp.ReportsV2
  [Expand]DevExpress.ExpressApp.ReportsV2.Mobile
  [Expand]DevExpress.ExpressApp.ReportsV2.Web
  [Expand]DevExpress.ExpressApp.ReportsV2.Win
  [Expand]DevExpress.ExpressApp.Scheduler
  [Expand]DevExpress.ExpressApp.Scheduler.Web
  [Expand]DevExpress.ExpressApp.Scheduler.Win
  [Expand]DevExpress.ExpressApp.ScriptRecorder
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Web
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Win
  [Expand]DevExpress.ExpressApp.Security
  [Expand]DevExpress.ExpressApp.Security.Adapters
  [Expand]DevExpress.ExpressApp.Security.ClientServer.Wcf
  [Expand]DevExpress.ExpressApp.Security.EF.Adapters
  [Expand]DevExpress.ExpressApp.Security.Strategy
  [Expand]DevExpress.ExpressApp.Security.Xpo.Adapters
  [Expand]DevExpress.ExpressApp.StateMachine
  [Expand]DevExpress.ExpressApp.SystemModule
  [Expand]DevExpress.ExpressApp.Templates
  [Expand]DevExpress.ExpressApp.Templates.ActionContainers
  [Expand]DevExpress.ExpressApp.TreeListEditors
  [Expand]DevExpress.ExpressApp.TreeListEditors.Web
  [Expand]DevExpress.ExpressApp.TreeListEditors.Win
  [Expand]DevExpress.ExpressApp.Updating
  [Expand]DevExpress.ExpressApp.Utils
  [Expand]DevExpress.ExpressApp.Validation
  [Expand]DevExpress.ExpressApp.Validation.Web
  [Expand]DevExpress.ExpressApp.Validation.Win
  [Expand]DevExpress.ExpressApp.ViewVariantsModule
  [Expand]DevExpress.ExpressApp.Web
  [Expand]DevExpress.ExpressApp.Web.Controls
  [Expand]DevExpress.ExpressApp.Web.Editors
  [Expand]DevExpress.ExpressApp.Web.Editors.ASPx
  [Expand]DevExpress.ExpressApp.Web.SystemModule
  [Expand]DevExpress.ExpressApp.Web.Templates
  [Expand]DevExpress.ExpressApp.Web.Utils
  [Expand]DevExpress.ExpressApp.Win
  [Expand]DevExpress.ExpressApp.Win.Core
  [Expand]DevExpress.ExpressApp.Win.Editors
  [Expand]DevExpress.ExpressApp.Win.Model
  [Expand]DevExpress.ExpressApp.Win.SystemModule
  [Expand]DevExpress.ExpressApp.Win.Templates
  [Expand]DevExpress.ExpressApp.Win.Templates.Navigation
  [Expand]DevExpress.ExpressApp.Win.Utils
  [Expand]DevExpress.ExpressApp.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Expand]DevExpress.ExpressApp.Xpo
  [Expand]DevExpress.ExpressApp.Xpo.Utils
  [Collapse]DevExpress.Persistent.Base
   [Expand]ActionAttribute Class
   [Expand]CaptionsForBoolValuesAttribute Class
   [Expand]CreatableItemAttribute Class
   [Expand]CurrentUserDisplayImageAttribute Class
   [Expand]CustomFormatObjectEventArgs Class
   [Expand]CustomGetValueEventArgs Class
   [Expand]DataSourceCriteriaAttribute Class
   [Expand]DataSourceCriteriaPropertyAttribute Class
   [Collapse]DataSourcePropertyAttribute Class
     DataSourcePropertyAttribute Members
    [Expand]DataSourcePropertyAttribute Constructor
    [Expand]DataSourcePropertyAttribute Properties
    [Expand]DataSourcePropertyAttribute Methods
    DataSourcePropertyIsNullMode Enumeration
   [Expand]DefaultClassOptionsAttribute Class
   [Expand]EditorAliasAttribute Class
    EmptyEntriesMode Enumeration
    ExpandObjectMembers Enumeration
   [Expand]ExpandObjectMembersAttribute Class
   [Expand]FileAttachmentAttribute Class
   [Expand]FileTypeFilterAttribute Class
   [Expand]FriendlyKeyPropertyAttribute Class
   [Expand]IAreaInfo Interface
   [Expand]IBaseMapsMarker Interface
   [Expand]IDashboardData Interface
   [Expand]IFileData Interface
   [Expand]ImageEditorAttribute Class
    ImageEditorMode Enumeration
   [Expand]ImageNameAttribute Class
   [Expand]ImagesForBoolValuesAttribute Class
    ImageSizeMode Enumeration
   [Expand]IMapsMarker Interface
   [Expand]ImmediatePostDataAttribute Class
   [Expand]IndexAttribute Class
   [Expand]IPermissionPolicyRole Interface
   [Expand]IPermissionPolicyRoleWithUsers Interface
   [Expand]IPermissionPolicyUser Interface
   [Expand]ISupportFullName Interface
   [Expand]IValueManager<ValueType> Interface
   [Expand]IValueManagerBase Interface
   [Expand]IVectorMapsMarker Interface
   [Expand]IVectorMapsPieMarker Interface
    LookupEditorMode Enumeration
   [Expand]LookupEditorModeAttribute Class
    MethodActionSelectionDependencyType Enumeration
   [Expand]NavigationItemAttribute Class
   [Expand]NonCloneableAttribute Class
   [Expand]NotClonedInfoAttribute Class
   [Expand]ObjectCaptionFormatAttribute Class
   [Expand]ObjectFormatter Class
    SecurityPermissionPolicy Enumeration
    SecurityPermissionState Enumeration
   [Expand]ToolTipAttribute Class
   [Expand]ValueManager Class
   [Expand]VisibleInDashboardsAttribute Class
   [Expand]VisibleInDetailViewAttribute Class
   [Expand]VisibleInListViewAttribute Class
   [Expand]VisibleInLookupListViewAttribute Class
   [Expand]VisibleInReportsAttribute Class
  [Expand]DevExpress.Persistent.Base.General
  [Expand]DevExpress.Persistent.Base.ReportsV2
  [Expand]DevExpress.Persistent.Base.Security
  [Expand]DevExpress.Persistent.BaseImpl
  [Expand]DevExpress.Persistent.BaseImpl.EF
  [Expand]DevExpress.Persistent.BaseImpl.EF.PermissionPolicy
  [Expand]DevExpress.Persistent.BaseImpl.PermissionPolicy
  [Expand]DevExpress.Persistent.Validation
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

DataSourcePropertyAttribute Class

Applied to business classes' reference and collection properties. Specifies the name of a collection property used as the data source for a List View displayed in a Lookup Property Editor or invoked by the LinkUnlinkController.LinkAction Action in a popup window.

Namespace:DevExpress.Persistent.Base
Assembly:DevExpress.ExpressApp.v19.1.dll

Expanded Syntax

Expanded Remarks

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 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.

Note

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.

You can set the collection that will be displayed by the Lookup List View when the source property is not specified. To do this, pass a DataSourcePropertyIsNullMode enumeration value as the DataSourceProperty attribute's DataSourcePropertyIsNullMode parameter. If you pass the DataSourcePropertyIsNullMode.CustomCriteria value, specify criteria for filtering the target property's data source. To do this, pass the criteria using the DataSourcePropertyIsNullCriteria parameter. In the criteria, you can use Function Criteria Operators and the Current Object Parameter.

To see examples of this attribute in use, refer to the How to: Implement Cascading Filtering for Lookup List Views topic.

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.

Note

  • 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.

Expanded Inheritance Hierarchy

System.Object
    System.Attribute
       DevExpress.Persistent.Base.ModelExportedValuesAttribute
          DataSourcePropertyAttribute

Expanded See Also

Is this topic helpful?​​​​​​​