expressappframework-devexpress-dot-expressapp-dot-actions-dot-actionbase-c90ff002.md
Specifies a context for enabling an Action.
Namespace : DevExpress.ExpressApp.Actions
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
[DefaultValue(SelectionDependencyType.Independent)]
public SelectionDependencyType SelectionDependencyType { get; set; }
<DefaultValue(SelectionDependencyType.Independent)>
Public Property SelectionDependencyType As SelectionDependencyType
| Type | Default | Description |
|---|---|---|
| SelectionDependencyType | Independent |
A SelectionDependencyType enumeration value identifying a context type.
|
Available values:
| Name | Description |
|---|---|
| Independent |
An Action does not require objects to be selected.
| | RequireSingleObject |
An Action is available when a single object is selected.
| | RequireMultipleObjects |
An Action is available when one or more objects are selected.
|
Use this property to make the current Action dependent on whether a single object or multiple objects are selected in the current View.
Note
The Action is hidden if the selection context is not available (for example, when the Controller is not derived from ViewController).
You can set another value in the Controller’s constructor or Designer. This value is saved to the Application Model‘s ActionDesign | Actions | <Action> node. You can change this value in the Model Editor. In a UI, the value which is specified in the Application Model’s .xafml file that was loaded last, will be displayed. For information on the order of Application Model differences loading, refer to the Application Model Basics topic.
The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectionDependencyType property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
PopupWindowShowAction action = new PopupWindowShowAction(this, "AssignJobs", PredefinedCategory.RecordEdit);
action.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects;
action.CustomizePopupWindowParams += new CustomizePopupWindowParamsEventHandler(action_CustomizePopupWindowParams);
roleGeneratorAction.Execute += new SimpleActionExecuteEventHandler(RoleGeneratorAction_Execute);
roleGeneratorAction.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects;
Actions.Add(roleGeneratorAction);
See Also