Log In
[Expand]Welcome to DevExpress .NET Documentation
[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]Document Server
[Expand]Report Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
 [Expand]Design-Time Features
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Scheduler and Notifications
  [Collapse]Miscellaneous UI Customizations
    How to: Add a Button to a Detail View Using Custom View Item
    How to: Add an XAF Mobile Custom Module
    How to: Adjust the Size and Style of Pop-up Dialogs (ASP.NET)
    How to: Adjust the Windows' Size and Style
    How to: Change an Application Logo and Info
    How to: Create a Custom Control Detail Item
    How to: Customize a Window Caption
    How to: Customize ASP.NET Layout Elements Using Custom CSS Classes
    How to: Customize Export Options of the Printing System
    How to: Customize the Conditional Appearance Module Behavior
    How to: Customize Window Status Messages (WinForms)
    How to: Enable High DPI Support in a WinForms Application
    How to: Implement a Custom Messaging Class
    How to: Include an Action to a Detail View Layout
    How to: Raise XAF Callbacks from Client-Side Events and Process these Callbacks on Server
    How to: Set Images and Captions for Enumeration Values
    How to: Show a Custom Window with an Embedded XAF View
    How to: Show a Custom Windows Form
    How to: Use a Custom Plugin in a Mobile Application
    How to: Use a Custom Splash Screen
    How to: Use a DevExtreme Chart in a Mobile Application
    How to: Use Custom Themes in ASP.NET Applications
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Include an Action to a Detail View Layout

In specific scenarios, you may need to place an Action in a View and not a toolbar. In this case, you need to use an Action Container View Item. The Action Container View Item is used to display a particular Action Container in a UI. Use this approach when you need to place an Action on a Detail View or Dashboard View layout. To add a button to a Detail View, execute the following steps.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1847.

  • Create a Controller, add a Simple Action to it and handle the Action's Execute event. For a step-by-step guide, refer to the Add a Simple Action tutorial. When running the application, a button will be created to represent the Simple Action. The code implemented in the Execute event handler will be performed when an end-user clicks this button.
  • Create a new Action category by setting the ActionBase.Category to a custom value by selecting the current value text and typing a custom value. For instance, you can set the Action's category to "MyCategory". Rebuild your project.

  • Invoke the Model Editor for your platform-independent Module project and navigate to the required Views | DetailView node (if the Model Editor is already opened, restart it). Add a new ActionContainerViewItem child node to the Detail View's Items node via the context menu.

  • Set the newly created node's Id property to "MyActionContainer" and the ActionContainer property to "MyCategory".

  • Focus the Views | DetailView | Layout node. Right-click on an empty space to invoke the layout customization dialog, then place the newly-created control at the required location. For details on how to change the layout, refer to the View Items Layout Customization topic.

  • Run the application to make sure that the button is added to the required Detail View.

Expanded See Also

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