Start by importing this question to your question library, then adding it to the same page as your second grid question:
http://sawtoothsoftware.com/community-question-library/1739-disable-graphical-inputs
Now add this code to your second grid question:
<script>
$(document).ready(function(){
[% Begin Unverified Perl
my $firstGridQ = 'GridQ1';
my $output = '';
for (my $r = 1; $r <= 8; $r++) {
for (my $c = 1; $c <= 7; $c++) {
if (GETVALUE($firstGridQ . '_r' . $r . '_c' . $c) == 1) {
$output .= 'SSI_DisableGraphicalInput("' . QUESTIONNAME() . '_r' . $r .'_c' . $c . '");';
}
}
}
return $output;
End Unverified %]
})
</script>
Replace "GridQ1" with the name of the first grid question.