Focus method not working on asp.net gridview -


i have web page gridview. received requirement first checkbox on gridview should have focus when page loads. put following code:

checkbox chkbox = (checkbox)grdmenupublichealth.rows[0].findcontrol("chkselect"); //chkbox.checked = true; chkbox.focus();

i put checked method in make sure checkbox being found, , works. however, focus() method doesn't appear working. has run before?

thanks in advance guidance.

i found following jquery worked:

<script type="text/javascript">     $(document).ready(function () {         $('input[type=checkbox]:first').focus();     }); </script> 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -