How to: Place an Action in a Different Location
- 2 minutes to read
This article explains how to move an Action to another Action Container.
Actions are toolbar items or other controls that execute associated code when a user interacts with them.
Action Containers are controls that display one or more Actions. XAF maps Actions to Action Containers based on the Category property values.
To change the location of an Action in the application’s UI, move the Action from its current Action Container to another one.
Note
For the purposes of this article, you can use the MainDemo application installed as a part of the XAF package. The default location of the application is %PUBLIC%\Documents\DevExpress Demos 24.1\Components\XAF.
In the MainDemo application, the ClearTaskAction
Action belongs to the RecordEdit
Action Container. The image below shows the current location of ClearTaskAction
in the UI:
- ASP.NET Core Blazor
- Windows Forms
The instructions below explain how to move ClearTaskAction
to another location.
In the Solution Explorer, expand the
MainDemo.Module
project and double-click the Model.DesignedDiffs.xafml file to open it in the Model Editor.Navigate to the ActionDesign | ActionToContainerMapping node and expand it. Child nodes of the ActionToContainerMapping node correspond to the Action Containers of your application.
Expand the RecordEdit node. Drag the ClearTasksAction child node to the View node.
Save the changes and run the application. When you invoke the Employee Detail View, the
ClearTaskAction
Action appears in a different location:- ASP.NET Core Blazor
- Windows Forms
Tip
To change the location of an Action in code, handle the ActionControlsSiteController.CustomizeContainerActions event.