ASPxClientGridView.BatchEditEndEditing Event
Occurs when a grid leaves the batch edit mode.
Declaration
BatchEditEndEditing: ASPxClientEvent<ASPxClientGridViewBatchEditEndEditingEventHandler<ASPxClientGridView>>
Event Data
The BatchEditEndEditing event's data class is ASPxClientGridViewBatchEditEndEditingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
cancel | Specifies whether to cancel the related action (for example, row edit, export). Inherited from ASPxClientCancelEventArgs. |
focusedColumn | Gets the column to which the edited cell belongs. |
key | Gets the row’s key. |
rowValues | Gets a hashtable that maintains information about editable cells. |
visibleIndex | Gets the visible index of the row whose cells has been edited. |
Remarks
The BatchEditEndEditing event is raised when the grid leaves the edit mode (for a cell/row) due to an end-user interaction or programmatic call to the ASPxClientGridViewBatchEditApi.EndEdit method. The event provides arguments that allow you to leave a particular cell in the edit mode.
An argument object provided by the events contains the ASPxClientGridViewBatchEditEndEditingEventArgs.rowValues structure. This is a hashtable that maintains information about editable cells in the following manner:
rowValues = {
"0": {
value: "someValue",
text: "someDisplayText"
}
}
//Here, "0" is an example of the column index specifying the corresponding row cell
You can manipulate entries of this hashtable to initialize/modify editor values or prevent displaying editors for particular cells by removing the corresponding entries from ASPxClientGridViewBatchEditEndEditingEventArgs.rowValues.
Note that if the GridViewBatchEditSettings.EditMode property is set to Cell, the ASPxClientGridViewBatchEditEndEditingEventArgs.rowValues hashtable contains all values of an edited row, but only the value of an edited cell is used to update the row. The edited cell is specified by the ASPxClientGridViewBatchEditStartEditingEventArgs.focusedColumn property passed to the ASPxClientGridView.BatchEditStartEditing event.
When the BatchEditEndEditing event fires after a cell value edit, the cell value is not yet updated. In this case, to get the updated cell value using the ASPxClientGridViewBatchEditApi.GetCellValue method in the BatchEditEndEditing event handler, use the setTimeout function.
function onBatchEndEditing(s, e) {
window.setTimeout(function () {
var index = e.visibleIndex;
var col = GridView.GetColumnByField("C2");
var res = GridView.batchEditApi.GetCellValue(index, "C2",false);
console.log(res);
}, 10);
}
Online Examples
- ASPxGridView - BatchEdit - How to use and modify a control placed in DataItemTemplate
- ASPxGridView in Batch Edit mode - Implement the Select All feature for the CheckBox column