Skip to main content
All docs
V24.2
.NET 8.0+

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.2\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
ASP.NET Core Blazor - Current location of ClearTaskAction, DevExpress
Windows Forms
Windows Forms - Current location of ClearTaskAction, DevExpress

The instructions below explain how to move ClearTaskAction to another location.

  1. In the Solution Explorer, expand the MainDemo.Module project and double-click the Model.DesignedDiffs.xafml file to open it in the Model Editor.

  2. Navigate to the ActionDesign | ActionToContainerMapping node and expand it. Child nodes of the ActionToContainerMapping node correspond to the Action Containers of your application.

  3. Expand the RecordEdit node. Drag the ClearTasksAction child node to the View node.

    Rearrangement of Actions in Model Editor, DevExpress

  4. 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
    ASP.NET Core Blazor - New location of ClearTaskAction, DevExpress
    Windows Forms
    windows Forms - New location of ClearTaskAction, DevExpress

Tip

To change the location of an Action in code, handle the ActionControlsSiteController.CustomizeContainerActions event.

See Also