Verify Data Validation For Entire Grid

I have 2 grids on a page each with its own data processor,

I am using the sendData command to first run checkBeforeUpdate to validate some columns in each that may or maynot have been edited then if not valid they highlight in red, If valid the data is saved to DB which is all to be expected.

However I need a way to validate both Grids and only save the data if both grids pass. If Validation fails on either grid I need to prevent the sendData commands for Both grids not just the one that fails Validation.

Basically I am looking for a function that returns true/false on a grid to verify all cells valid or not

I am Using dhtmlxSuite_2009Rel1_pro_90226.

Thanks in advance.

You can use next code

var valid = true;
for (var i=0; i<dp.updatedRows.length; i++)

where dp - dataprocessor instance