Back to Devexpress

ActionBase.SelectionDependencyType Property

expressappframework-devexpress-dot-expressapp-dot-actions-dot-actionbase-c90ff002.md

latest5.1 KB
Original Source

ActionBase.SelectionDependencyType Property

Specifies a context for enabling an Action.

Namespace : DevExpress.ExpressApp.Actions

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[DefaultValue(SelectionDependencyType.Independent)]
public SelectionDependencyType SelectionDependencyType { get; set; }
vb
<DefaultValue(SelectionDependencyType.Independent)>
Public Property SelectionDependencyType As SelectionDependencyType

Property Value

TypeDefaultDescription
SelectionDependencyTypeIndependent

A SelectionDependencyType enumeration value identifying a context type.

|

Available values:

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

|

Remarks

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.

xaf-how-to-show-persistent-objects-in-a-non-persistent-objects-view/CS/EFCore/ComplexDialogEF/ComplexDialogEF.Module/Controllers/MyController.cs#L16

csharp
PopupWindowShowAction action = new PopupWindowShowAction(this, "AssignJobs", PredefinedCategory.RecordEdit);
action.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects;
action.CustomizePopupWindowParams += new CustomizePopupWindowParamsEventHandler(action_CustomizePopupWindowParams);

XAF_How-to-get-role-code-from-the-UI/CS/XPO/GenerateRole/GenerateRole.Module/Controllers/RoleGeneratorController.cs#L31

csharp
roleGeneratorAction.Execute += new SimpleActionExecuteEventHandler(RoleGeneratorAction_Execute);
roleGeneratorAction.SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects;
Actions.Add(roleGeneratorAction);

See Also

Define the Scope of Controllers and Actions

ActionBase Class

ActionBase Members

DevExpress.ExpressApp.Actions Namespace