The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

BaseObjectSpace.ConfirmationRequired Event

Occurs when performing refresh or rollback operations with the current Object Space's persistent objects.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

public event EventHandler<ConfirmationEventArgs> ConfirmationRequired
Public Event ConfirmationRequired As EventHandler(Of ConfirmationEventArgs)
public event EventHandler<ConfirmationEventArgs> ConfirmationRequired
Public Event ConfirmationRequired As EventHandler(Of ConfirmationEventArgs)
public event EventHandler<ConfirmationEventArgs> ConfirmationRequired
Public Event ConfirmationRequired As EventHandler(Of ConfirmationEventArgs)

Event Data

The ConfirmationRequired event handler receives an argument of the DevExpress.ExpressApp.ConfirmationEventArgs type.

Remarks

The ConfirmationRequired event is raised as a result of calling the BaseObjectSpace.Refresh or BaseObjectSpace.Rollback method. Handle it to invoke a confirmation window of the type specified as the handler's ConfirmationEventArgs.ConfirmationType parameter. For this purpose, use the XafApplication.AskConfirmation method. It will show the required window with three buttons: Yes, No and Cancel. The end-user's selection will be returned as the ConfirmationResult enumeration value. Set this value to the handler's ConfirmationEventArgs.ConfirmationResult parameter. This will specify the remaining actions to be taken in the method which raised this event.

The following code demonstrates how to handle the ConfirmationRequired event via a View Controller:

public class MyViewController : ViewController {
   private void ObjectSpace_ConfirmationRequired(object sender, ConfirmationEventArgs e) {
      e.ConfirmationResult = Application.AskConfirmation(e.ConfirmationType);
   }
   private void MyViewController_Activated(object sender, EventArgs e) {
      View.ObjectSpace.ConfirmationRequired += 
         new EventHandler<ConfirmationEventArgs>(ObjectSpace_ConfirmationRequired);
   }
}

The ConfirmationRequired event is already handled by the WinModificationsController, activated for Detail Views in Windows Forms applications only. This Controller's handler invokes a confirmation window as described above. When the ConfirmationRequired method is invoked within a List View, or in an ASP.NET Web application, a confirmation window is not invoked. You can change this behavior by handling the ConfirmationRequired event.

See Also