Check All Checkbox of a grid by using JavaScript

function CheckAllBox()
{
var chkval = document.getElementById('ctl00_cphMain_grdCategory_ctl01_chkAll').checked;
try
{
for(var i=2;i<200;i++)
{
if(i<=9)
{
document.getElementById('ctl00_cphMain_grdCategory_ctl0'+i+'_chk').checked=chkval;
}
else
{
document.getElementById('ctl00_cphMain_grdCategory_ctl'+i+'_chk').checked=chkval;
}
}
}
catch(e){}
}

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>