[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Collapse]eXpressApp Framework
 [Collapse]Getting Started
  [Expand]Basic Tutorial (SimpleProjectManager Application)
  [Collapse]Comprehensive Tutorial (MainDemo Application)
   [Expand]Business Model Design
   [Expand]Extend Functionality
   [Collapse]UI Customization
     Place an Action in a Different Location
     Specify Action Settings
     Format a Business Object Caption
     Assign a Standard Image
     Assign a Custom Image
     Make a Property Calculable
     Filter Lookup Editor Data Source
     Format a Property Value
     Use a Multiline Editor for String Properties
     Localize UI Elements
     Add an Item to the New Action
     Add an Item to the Navigation Control
     Implement Property Value Validation in the Application Model
     Customize the View Items Layout
     Add an Editor to a Detail View
     Change Field Layout and Visibility in a List View
     Display a Detail View with a List View
     Make a List View Editable
     Add a Preview to a List View
     Filter List Views
     Apply Grouping to List View Data
     Choose the WinForms UI Type
     Toggle the WinForms Ribbon Interface
     Change Style of Navigation Items
   [Expand]Extra Modules
   [Expand]Security System
 [Expand]Design-Time Features
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Place an Action in a Different Location

In this lesson, you will learn how to place an Action in the required place. For this purpose, the ClearTasksAction that was defined in the Add a Simple Action lesson will be used. It is located together with the SaveTo, ExecuteReport and Refresh Actions. This Actions group is called View Action Containers (the ActionBase.Category property is set to "View" when implementing the ClearTasksAction). The remaining Actions are distributed among other Action Containers. In this lesson, you will move the ClearTasksAction to the RecordEdit Action Container.


Before proceeding, take a moment to review the following lessons.


You can also change an Action location in code by handling the ActionControlsSiteController.CustomizeContainerActions event.

  • Since the ClearTasksAction is implemented in the common application module, you can specify its location directly in this module. To do this, invoke the Model Editor by double-clicking the Model.DesignedDiffs.xafml file from the MySolution.Module project.

    The XAF application interface is based on the Application Model. The Model Editor is a tool for browsing and editing the Application Model. This tool is integrated in Visual Studio and displayed as a window pane. Commands specific to the Model Editor are available in the XAF Model Editor toolbar.

    If the XAF Model Editor toolbar is hidden, you can make it visible by checking the XAF Model Editor item in the VIEW | Toolbars menu.


    To learn more about Model Editor capabilities, refer to the Model Editor topic.

  • In the Model Editor, navigate to the ActionDesign | ActionToContainerMapping node. Its child nodes represent the Action Containers to which the Actions are mapped according to their Category property values. Expand the View node representing the View Action Container. Drag the ClearTasksAction child node to the RecordEdit node.


    Alternatively, you can use the context menu's Copy, Paste, Delete and Clone commands to modify the Application Model structure. The modified parts of the Application Model are displayed with a bold font. You can revert any node with all of its child nodes to their original state via the context menu's Reset Differences command.

  • Run the WinForms or ASP.NET application. Invoke a detail form, since the ClearTasksAction is activated for Detail Views only. The following image demonstrates that this Action is located with Actions that belong to the RecordEdit Action Container.

You can see the changes made in the lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.1\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/.


Next Lesson: Specify Action Settings

Expanded See Also

Is this topic helpful?​​​​​​​