[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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
   [Expand]Templates
    Action Containers
   [Expand]Views
   [Expand]View Items
    List Editors
    Ways to Access UI Elements and Their Controls
    Add and Override Images
    Text Notifications
    Ways to Show a Confirmation Dialog
    ASP.NET Web Application Appearance
    Ways to Customize a Mobile Application
    Application Personalization
    Using a Custom Control that is not Integrated by Default
    XAF Mobile Wrappers for DevExtreme Widgets
  [Expand]Controllers and Actions
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging, Testing and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Ways to Show a Confirmation Dialog

This topic describes how to show a confirmation message/dialog with additional fields.

This topic consists of the following sections:

Tip

Refer to the following topics if you want to show a text notification:

Expanded Using the ConfirmationMessage Property

Use the ActionBase.ConfirmationMessage property in code or IModelAction.ConfirmationMessage in the Model Editor to change a default confirmation message for built-in or custom Actions.

For example, implement the following Controller to change the Delete Action's confirmation message:

Click the Delete Action to see the result:

Expanded Using a New Detail View

This section demonstrates how to invoke pop-up window with a non-persistent object's Detail View (see DetailView).

Add the following non-persistent class to your platform-agnostic module project. Decorate this class with the DomainComponentAttribute to register it in the Types Info Subsystem.

Use one of the following approaches to show the confirmation message in a pop-up window when an Action is executed:

Using the CustomizePopupWindowParams event

  1. Create a new ViewController and PopupWindowShowAction in its constructor.
  2. In the Action's CustomizePopupWindowParams event, create a non-persistent Object Space (see NonPersistentObjectSpace), a new ConfirmationWindowParameters class instance, and the DetailView for this object.
  3. Specify the ConfirmationWindowParameters object's properties and set the CustomizePopupWindowParamsEventArgs.View parameter to the newly created Detail View to show it in the pop-up window.

The following images demonstrate this confirmation window:

Note

You can also process the OK and Close button clicks. For this purpose, use the CustomizePopupWindowParamsEventArgs.DialogController property to access the Dialog Controller, and subscribe to its Accepting (see DialogController.Accepting) and Canceling (see DialogController.Cancelling) events.

Using the ShowViewInPopupWindow method

  1. Create a new ViewController (see ViewController) and SimpleAction (see SimpleAction) in its constructor.
  2. In the Action's Execute event, create a non-persistent Object Space (see NonPersistentObjectSpace), a new ConfirmationWindowParameters class instance, and the DetailView for this object.
  3. Set the ConfirmationWindowParameters object's properties to the required values and call the ShowViewStrategyBase.ShowViewInPopupWindow method. Pass the newly created Detail View as the ShowViewInPopupWindow's first parameter to show this View in a pop-up. You can also pass delegates for processing the Ok and Cancel buttons click.

Expanded Using the Messaging Class' Methods

Use the Messaging class's methods to display a confirmation message with standard dialog buttons (see MessageBoxButtons) in WinForms applications. The following Controller demonstrates how to use this class to show a confirmation window:

The image below demonstrates this implementation result.

Expanded See Also

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