After Updating
if(($mode == "update") && ($rid != "-1") && $dgrid->IsOperationCompleted()){ // your operation here... }