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
Post a Comment