Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

SingleChoiceAction Class

Represents a Single Choice Action.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v20.2.dll


[ToolboxTabName("DX.20.2: XAF Actions")]
public class SingleChoiceAction :


The SingleChoiceAction class inherits both the basic functionality of Actions from the ActionBase class, and the functionality of Choice Actions - from the ChoiceActionBase class. Single Choice Actions are used to execute custom code when an end-user selects an item from the ChoiceActionBase.Items collection. You can populate this collection at design time via the Properties window. Select the Items property and click the ellipsis button provided for it. In the invoked ChoiceActionItems Collection Editor, add items and specify their settings.


Each item within the ChoiceActionBase.Items collection can contain child items as well. So, you can form a tree of items for a Single Choice Action. You can specify the type of a Single Choice Action’s items: they can represent either modes or operations. To do this, use the SingleChoiceAction.ItemType property.

To provide custom code to be executed when users select a single item within the Items collection, handle the SingleChoiceAction.Execute event. To access the selected item, use the handler’s SingleChoiceActionExecuteEventArgs.SelectedChoiceActionItem parameter.

To add a Single Choice Action to a Controller, drag and drop the SingleChoiceAction item from the Toolbox (the XAF Actions section) onto the Controller’s Designer area (see Add an Action with Option Selection).

Set the IModelActionWeb.IsPostBackRequired property to true to send a postback when a user executes an Action in an ASP.NET application. For example, for Actions that download files or change the application’s language.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SingleChoiceAction class.


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.


See Also