Selecting all Check Boxes in a Grid View

here is the java script code for selecting all the check Boxes Column in a Grid View..


function SelectAll()
{
var RowCount=null;
var ctl = 'grdAdmin_ctl';
RowCount=<%= grdAdmin.Rows.Count %>; //Getting number of rows in gridview
for(var i=2;i<=RowCount+1;i++)
{
var ChkId=null;
if (i<=9)
{
ChkId=document.getElementById(ctl+ '0' + i + '_chkSelect');
ChkId.checked=true;
}
else
{
ChkId=document.getElementById(ctl + i + '_chkSelect');
ChkId.checked=true;
}
}
return false;
}



Regards,
Anil Pandey


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: