Scenario
This example demonstrates how to implement the following behavior (which is default in Microsoft Outlook) in XAF Windows Forms applications:
- A user can create a new record, and when its detail form is opened he or she may close the form without entering any data (e.g., a new record was created by accident). In this case, the form can be closed without any save confirmation, because no user data needs to be saved.
- If a user enters some data into the form and then closes it, the save confirmation appears as expected not to lose entered data.
To implement it
Copy the WinSolution.Module.Win\SuppressConfirmationForNewObjectsDetailViewController.xx file into YourSolutionName.Module.Win project.
To test it
You can also run functional tests from the E2114.EasyTests\E2114.ets folder.
See Also:
WinModificationsController Class
ModificationsController.ModificationsHandlingMode
Core - Disable the confirmation dialog when closing a form with a new object left untouched
Question Comments
Added By: rushdan . at: 12/4/2014 2:08:46 AM
I have see example . That is great.
So I would like to ask, is it possible to apply for Web ?
Thanks
Added By: Dennis (DevExpress Support) at: 12/4/2014 2:40:43 AM @rushdan: This solution cannot be applied to the Web version because there are no such confirmation dialogs there by default.Added By: Paul Kubb at: 3/31/2016 9:04:33 PM Just a little comment that I think this feature should be out-of-the-box.Popping out this message every time even nothing touched is annoying and I don't think anybody will like it.