Skip to main content
A newer version of this page is available. .

ActionBase.ConfirmationMessage Property

Specifies the confirmation message displayed when an end-user executes an Action.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

[DefaultValue("")]
public string ConfirmationMessage { get; set; }

Property Value

Type Default Description
String String.Empty

A string containing the current Action’s confirmation message.

Remarks

When executing an Action, a pop-up window is invoked to display a confirmation message if it is specified by the ConfirmationMessage property. To change an Action’s confirmation message at run time, use the Application Model’s IModelAction.ConfirmationMessage property of the corresponding ActionDesign | Actions | <Action> node. You can do this either via the Model Editor or by accessing the Application Model in code.

You can include the ‘{0}’ format item in the confirmation message. This item will be replaced at run time with either the currently selected object’s caption (if the ActionBase.SelectionDependencyType property is set to RequireSingleObject) or the selected objects count (if the ActionBase.SelectionDependencyType property is set to RequireMultipleObjects). To learn more about formatting confirmation messages, refer to the Specify Action Settings tutorial lesson.

In Windows Forms applications, the confirmation dialog contains “Yes” and “No” buttons. Meantime, in ASP.NET applications, the buttons are “OK” and “Cancel”. Keep this fact in mind when composing text for the ConfirmationMessage property.

Tip

To use data from objects that are currently selected by user, follow the approach described in the How to: Access Objects Selected in the Current View example.

The example below adds a confirmation message to a SimpleAction, and if the user confirms, assigns a Contact‘s FirstName value to the NickName property.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using MainDemo.Module.BusinessObjects;
// ...
public class SetNickNameController : ObjectViewController<DetailView, Contact> {
    public SetNickNameController() {
        SimpleAction setNickNameAction = new SimpleAction(this, "SetNickName", PredefinedCategory.Edit);
        setNickNameAction.ConfirmationMessage = "Do you want to continue?";
        setNickNameAction.Execute += SetNickNameAction_Execute;
    }
    private void SetNickNameAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
        Contact currentObject = ViewCurrentObject;
        if(currentObject != null) {
            currentObject.NickName = currentObject.FirstName;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ConfirmationMessage property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also