Hi there,
I have a problem to access a checkbox inside GridView using
row index using javascript.
Here is the code:
[CODE=javascript]var c;
var cellValue;
var rCount = 0;
var cellControl;
gridViewCtl = document.getEle mentById("ctl00 _ContentPlaceHo lder1_gvQueue_Q ueue");
rCount = gridViewCtl.row s.length;
for(c=2; c<=rCount; c++)
{
var row = gridViewCtl.row s[c];
cellValue = getCellValue(c, 10); // Gets value in the 10 cell - OK
cellControl = getCellControl( c,1); // Trying to get check box in 1 cell
// alert(cellContr ol);
if( cellValue == "Test" )
{
// set CheckBox status depends on cellValue on current row
}
}
function getCellControl( rowIdx, colIdx)
{
var gridCell = getGridColumn(r owIdx, colIdx);
if (null != gridCell)
{
// here is the isseu:
if(gridCell.typ e =="checkbox")
{alert("!");}
else{alert("-" + gridCell.type); }
return gridCell.contro ls;
}
return null;
}
[/CODE]
Thanks for your help
Vladzeem
I have a problem to access a checkbox inside GridView using
row index using javascript.
Here is the code:
[CODE=javascript]var c;
var cellValue;
var rCount = 0;
var cellControl;
gridViewCtl = document.getEle mentById("ctl00 _ContentPlaceHo lder1_gvQueue_Q ueue");
rCount = gridViewCtl.row s.length;
for(c=2; c<=rCount; c++)
{
var row = gridViewCtl.row s[c];
cellValue = getCellValue(c, 10); // Gets value in the 10 cell - OK
cellControl = getCellControl( c,1); // Trying to get check box in 1 cell
// alert(cellContr ol);
if( cellValue == "Test" )
{
// set CheckBox status depends on cellValue on current row
}
}
function getCellControl( rowIdx, colIdx)
{
var gridCell = getGridColumn(r owIdx, colIdx);
if (null != gridCell)
{
// here is the isseu:
if(gridCell.typ e =="checkbox")
{alert("!");}
else{alert("-" + gridCell.type); }
return gridCell.contro ls;
}
return null;
}
[/CODE]
Thanks for your help
Vladzeem
Comment