I would suggest giving a common
css class to the checkbox mark ups in all
GridView
. Then select all checkboxes using a single query with the parent GridView which contains all other children. Something like... Easy and quick.
$
('#ParentGrid .commonCheckBoxClassForAllCheckboxes').attr("checked", "checked");