expressappframework-112815-ui-construction-controllers-and-actions-actions-how-to-reorder-an-action-containers-actions-collection.md
In an XAF application UI, Actions are located within Action Containers. You can use the ActionBase.Category property and the Application Model’s ActionDesign | ActionToContainerMapping node to move the Action to another Action Container (see How to: Place an Action in a Different Location). This topic describes how to reorder Actions within a specific container.
Presume you have the MyAction Action implemented in the MyController Controller. The ActionBase.Category property is set to View for this Action. This means that the Action is displayed within the View Action Container. This Container may also contain other Actions - custom Actions, and actions from referenced modules. To reorder Actions of the View Action Container (or any other Action Container), invoke the Model Editor for the WinForms or ASP.NET Core Blazor application project. Locate the ActionDesign | ActionToContainerMapping | View node. The following image shows that there are three Actions in the View Action Container.
To reorder these Actions, change the Index property for each Action. For instance, use the “0” value for MyAction , “1” - for Refresh , “2” - for ExecuteReport.
If you run the application, you can ensure that the Actions order is changed as follows.
Note
Tip
To change Action Containers order and location, customize the Template. In WinForms applications, you can also use the runtime customization capabilities.
See Also
GitHub Example: XAF - Add Custom Buttons (Actions) to Lookup and Popup Windows