ASPxClientGridView.BatchEditChangesPreviewShowing Event
Fires before the grid switches to Preview Changes mode.
Declaration
BatchEditChangesPreviewShowing: ASPxClientEvent<ASPxClientCancelEventHandler<ASPxClientGridView>>
Event Data
The BatchEditChangesPreviewShowing event's data class is ASPxClientCancelEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
cancel | Specifies whether to cancel the related action (for example, row edit, export). |
Remarks
In Preview Changes mode, ASPxGridView shows modified rows from all grid pages. To support this functionality, the grid keeps changes on callbacks when a user interacts with unsaved modified data (for instance, when a user navigates to another page within the grid or sorts data).
The BatchEditChangesPreviewShowing
event fires in the following cases:
- A user clicks the Preview changes button.
- You call the BatchEditApi.ShowChangesPreview method.
In the example below, the grid does not switch to Preview Changes mode if the current page contains invalid data within the modified rows. To enable this behavior, set the cancel argument property to true
.
<dx:ASPxGridView ID="Grid" runat="server" ClientInstanceName="ClientGrid" KeyFieldName="CustomerID">
<!-- ... -->
<SettingsEditing Mode="Batch" />
<ClientSideEvents BatchEditChangesPreviewShowing="OnBatchEditChangesPreviewShowing" .../>
</dx:ASPxGridView>
function OnBatchEditChangesPreviewShowing(s, e) {
if (!s.batchEditApi.ValidateRows(true, true)) {
e.cancel = true;
}
}