Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Collapse]API Reference
  [Expand]DevExpress.EasyTest.Framework
  [Expand]DevExpress.ExpressApp
  [Collapse]DevExpress.ExpressApp.Actions
   [Collapse]ActionBase Class
     ActionBase Members
    [Collapse]ActionBase Properties
      ActionMeaning Property
      Active Property
      Application Property
      Caption Property
      Category Property
      ConfirmationMessage Property
      Controller Property
      Data Property
      DiagnosticInfo Property
      Enabled Property
      HasImage Property
      Id Property
      ImageName Property
      IsDisposed Property
      IsExecuting Property
      LockCount Property
      Model Property
      PaintStyle Property
      QuickAccess Property
      SelectionContext Property
      SelectionDependencyType Property
      Shortcut Property
      Tag Property
      TargetObjectsCriteria Property
      TargetObjectsCriteriaMode Property
      TargetObjectType Property
      TargetViewId Property
      TargetViewNesting Property
      TargetViewType Property
      TestName Property
      ToolTip Property
      TypeOfView Property
    [Expand]ActionBase Events
    [Expand]ActionBase Methods
   [Expand]ActionBaseEventArgs Class
    ActionMeaning Enumeration
   [Expand]ActionUrl Class
    ActiveItemsBehavior Enumeration
   [Expand]ChoiceActionBase Class
   [Expand]ChoiceActionItem Class
   [Expand]ChoiceActionItemCollection Class
    ChoiceActionItemFindTarget Enumeration
    ChoiceActionItemFindType Enumeration
   [Expand]CustomizeControlEventArgs Class
   [Expand]CustomizePopupWindowParamsEventArgs Class
    CustomizePopupWindowParamsEventHandler Delegate
    DefaultItemMode Enumeration
    EmptyItemsBehavior Enumeration
   [Expand]HandleExceptionEventArgs Class
    ImageMode Enumeration
   [Expand]ParametrizedAction Class
   [Expand]ParametrizedActionExecuteEventArgs Class
    ParametrizedActionExecuteEventHandler Delegate
   [Expand]PopupWindowShowAction Class
   [Expand]PopupWindowShowActionExecuteEventArgs Class
    PopupWindowShowActionExecuteEventHandler Delegate
    SelectionDependencyType Enumeration
   [Expand]SimpleAction Class
   [Expand]SimpleActionExecuteEventArgs Class
    SimpleActionExecuteEventHandler Delegate
   [Expand]SingleChoiceAction Class
   [Expand]SingleChoiceActionExecuteEventArgs Class
    SingleChoiceActionExecuteEventHandler Delegate
    SingleChoiceActionItemType Enumeration
   [Expand]SupportClientScriptsExtensions Class
    TargetObjectsCriteriaMode Enumeration
  [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.Editors
  [Expand]DevExpress.ExpressApp.Mobile.SystemModule
  [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.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.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.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Expand]DevExpress.ExpressApp.Xpo
  [Expand]DevExpress.Persistent.Base
  [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]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

ActionBase.TargetObjectsCriteria Property

Specifies a logical expression (criteria) for enabling an Action.

Namespace:DevExpress.ExpressApp.Actions
Assembly:DevExpress.ExpressApp.v17.1.dll

Expanded Syntax

Property value

Type: String
A string value representing a logical expression (criteria).
The default is null.

Expanded Remarks

This property allows defining for what objects an Action will be enabled or disabled. A disabled Action is visible in the UI, but it is grayed out and cannot be executed. Specify a logical expression built in accordance with the Criteria Language Syntax there, and the Action will be enabled only for objects that fit this expression. The Action should be added in a View Controller - Actions created in other Controller types are not affected by this property.

Note

The TargetObjectsCriteria property has an effect only if the SelectionDependencyType property is set to RequireSingleObject or RequireMultipleObjects. The manner in which an Action's enabled state is calculated when several objects are selected is determined by the TargetObjectsCriteriaMode property.

You can set the value of the TargetObjectsCriteria property in code, in the Controller's designer or in the Model Editor. This value will be saved to the IModelAction.TargetObjectsCriteria property of the Application Model's ActionDesign | Actions | <Action> node. The following image demonstrates how the TargetObjectsCriteria property is specified in the Model Editor:

You can use Function Criteria Operators in the criteria. The following code demonstrates how to do this. Having this criteria specified, the Action will be enabled when the DueDate property value of the currently selected Task objects is less than or equal to the current date:

The TargetObjectsCriteria property is appropriate for Actions displayed only for specific business object types. If an Action is displayed for a type that does not have properties specified in the TargetObjectsCriteria expression, an exception will be thrown. That is why if you wish to define the TargetObjectsCriteria for an Action that can be displayed for multiple types (e.g., for one of the built-in actions), do this dynamically in code when a View of the required type is displayed, and clear the passed value when this View is closed:

Expanded See Also

How would you rate this topic?​​​​​​​