Back to Devexpress

Add an Action that Displays a Pop-Up Window

expressappframework-402158-getting-started-in-depth-tutorial-blazor-add-actions-menu-commands-add-an-action-that-displays-a-pop-up-window.md

latest3.4 KB
Original Source

Add an Action that Displays a Pop-Up Window

  • May 07, 2025
  • 4 minutes to read

This lesson explains how to create an Action that shows a pop-up window. This type of Action is useful when users want to input multiple parameters in a pop-up dialog before they execute an Action.

Note

Before you proceed, take a moment to review the previous lessons:

In this tutorial, you will implement the ability to add notes from a predefined list to task descriptions.

Implement a New Entity

  1. Expand the MySolution.Module project and right-click the Business Objects folder. Choose Add | Class…. Specify Note.cs as the new class name and click Add.

  2. Replace the generated class declaration with the following code snippet:

  3. Register the Note type in DbContext. Edit the BusinessObjects\MySolutionDbContext.cs file as shown below:

Create a View Controller

  1. Add a new View Controller to the MySolution.Module project. Name it PopupNotesController.

  2. In the PopupNotesController.cs file, specify the controller properties:

  3. Add the ShowNotesAction action and handle its CustomizePopupWindowParams event:

  4. Add and handle the ShowNotesAction‘s Execute event. It occurs when a user clicks OK in the pop-up window. The event handler code appends the Note.Text property value to the Task.Description property value.

  5. Run the application.

For an example of how to create and show a Detail View, refer to the following topic: How to: Create and Show a Detail View of the Selected Object in a Popup Window.

Note

CodeRush allows you to add Actions and Controllers with a few keystrokes. To learn about the Code Templates for XAF , refer to the following help topic: XAF Templates.

Next Lesson

Add an Action with Option Selection

See Also

Create, Read, Update and Delete Data

SetModified

Actions (Menu Commands)

Controllers (UI Logic & Interaction)

PopupWindowShowAction

SaveOnAccept

How to: Adjust the Size and Style of Pop-up Dialogs (Blazor)