ASPxClientGridViewBatchEditApi.ValidateRows Method
Validate data in rows when the grid in batch edit mode.
Declaration
ValidateRows(
validateOnlyModified?: boolean,
validateOnCurrentPageOnly?: boolean
): boolean
Parameters
Name | Type | Description |
---|---|---|
validateOnlyModified | boolean | true, to validate only modified rows; otherwise (false), to validate all rows. |
validateOnCurrentPageOnly | boolean | true, to validate rows only on the current page; otherwise (false), to validate modified rows across all pages. |
Returns
Type | Description |
---|---|
boolean | true, if data in rows passes validation; otherwise, false. |
Remarks
This method allows you to validate data in grid rows. The table below illustrates how to use the method’s parameters:
validateOnlyModified | validateOnCurrentPageOnly | Result |
---|---|---|
true | true | The grid validates all modified rows on the current page. |
true | false | The grid validates all modified rows across all pages. |
false | true | The grid validates all rows on the current page. |
false | false | The grid validates all rows on the current page and all modified rows across other pages. |
function OnClick() {
if (Grid.batchEditApi.HasChanges()) {
if (!Grid.batchEditApi.ValidateRows()) {
alert('Custom error message');
} else {
Grid.UpdateEdit();
}
}
}
Note that you can use the ASPxClientGridViewBatchEditApi.ValidateRow method to validate the specified row.