GridBatchEditSettings.ShowConfirmOnLosingChanges Property
Specifies whether the grid control displays the Confirmation dialog box to avoid losing unsaved changes.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Remarks
In batch edit mode, the grid control allows a user to modify batches of grid data and send it to the server in a single request. To avoid losing unsaved modified data, the control shows the Confirmation dialog box. A user can confirm the action and lose the modified data or cancel the action, save changes, and repeat the action.
The grid control displays the Confirmation dialog box in the following cases:
A user reloads or leaves the page.
On callbacks and postbacks. Note that ASPxGridView shows the Confirmation dialog box on callbacks when the KeepChangesOnCallbacks property is disabled.
To customize the Confirmation dialog text, specify the ASPxGrid.SettingsText.ConfirmOnLosingBatchChanges property (the ASPxTreeList.SettingsText.ConfirmOnLosingBatchChanges property for ASPxTreeList).
The grid allows you to use one of the following options to disable the Confirmation dialog box:
Set the
ShowConfirmOnLosingChanges
property tofalse
. In this case, the grid control does not show the Confirmation dialog box and loses unsaved changes.<dx:ASPxGridView ID="ASPxGridView1" runat="server" KeyFieldName="ProductID"> <%--...--%> <SettingsEditing Mode="Batch"> <BatchEditSettings ShowConfirmOnLosingChanges ="false" /> </SettingsEditing> </dx:ASPxGridView>
Set the cancel argument property to
true
in the client-sideBatchEditConfirmShowing
event handler (ASPxClientGridView.BatchEditConfirmShowing, ASPxClientCardView.BatchEditConfirmShowing, ASPxClientVerticalGrid.BatchEditConfirmShowing, ASPxTreeList.BatchEditConfirmShowing). In this case, the grid control does not show the Confirmation dialog box and keeps changes on callbacks and postbacks.<dx:ASPxGridView ID="ASPxGridView1" runat="server" KeyFieldName="ProductID"> <%--...--%> <SettingsEditing Mode="Batch" /> <ClientSideEvents BatchEditConfirmShowing="Grid_BatchEditConfirmShowing" /> </dx:ASPxGridView>
function Grid_BatchEditConfirmShowing(s, e) { e.cancel = true; }
For more information on batch edit mode in a particular control, refer to the following topics:
- ASPxGridView - Batch Edit Mode
- ASPxCardView - Batch Edit Mode
- ASPxVerticalGrid - Batch Edit Mode
- ASPxTreeList - Batch Edit Mode
Limitations
For ASPxTreeList, the
false
value of theShowConfirmOnLosingChanges
property does not disable the Confirmation dialog box that the control displays when a user leaves the page.iOS devices do not display the Confirmation dialog box when a user leaves the page.