<script language="javascript" type="text/javascript" >
function SelectAll(SelBtn)
{
var gvET = document.getElementById("GridView1");
var rCount = gvET.rows.length;
var btnSel = SelBtn.value;
var rowIdx;
// check the Page Count is greater than 1 then rowindex will start from 2 else 1
if(document.getElementById("hidgridpagecount").value>1)
{
rowIdx=2;
}
else
{
rowIdx=1;
}
for (rowIdx; rowIdx<=rCount-1; rowIdx++)
{
var rowElement = gvET.rows[rowIdx];
var chkBox = rowElement.cells[0].firstChild;
if (btnSel == 'Select All')
{
chkBox.checked = true;
}
else
{
chkBox.checked = false;
}
}
if (btnSel == 'Select All')
{
document.getElementById('btnSelAll_Top').value ="Deselect All";
document.getElementById('btnSelAll_Bot').value ="Deselect All";
}
else
{
document.getElementById('btnSelAll_Top').value ="Select All";
document.getElementById('btnSelAll_Bot').value ="Select All";
}
return false;
}
</script>
No comments:
Post a Comment