function SelectAll(ctr)
{
var dg = document.getElementById( "dgdMaterialRequest ");
for(var j = 2; parseInt(j) <= dg.rows.length; j++)
{
if(j.toString().length==1)
{
j= "0 " + j.toString();
}
var chk = document.getElementById "dgdMaterialRequest_ctl "+j+ "_cbIsSelected ");
if(chk != null && chk.disabled != true)
{
chk.checked=ctr.checked;
CheckBoxSelected(chk,j);
}
}
}
function CheckBoxSelected(Ctr,rowID)
{
if(rowID.toString().length==1)
{
rowID= 'ctl0 '+(rowID);
}
else
{
rowID= 'ctl '+(rowID);
}
var sumDrawQuantity=0;
var materialID=document.getElementById( "dgdMaterialRequest_ "+rowID+ "_lblMaterialID ").innerText;
var waitForDrawQuantity=document.getElementById( "dgdMaterialRequest_ "+rowID+ "_lblWaitForDrawQuantity ");