Highlight GridView row clientside with javascript?

M

Marc Pavo

Since Ajax.net isn't production-worthy yet, I'm looking for any info on this
(as well as manipulating GridView from client script in general). Thank you!
 
M

Marc Pavo

Since GridView is just a table when rendered, all it takes is the table
object model and dhtml:

function updateGrid(iRow, sName, sCity, sState){
//new row
var gridView = document.getElementById('GridView1');
var oRow = gridView.insertRow();

var oCell = oRow.insertCell(0);
oCell.innerHTML = sName;
oCell = oRow.insertCell(1);
oCell.innerHTML = sCity;
oCell = oRow.insertCell(2);
oCell.innerHTML = sState;
/*update existing row
gridView.rows[iRow].cells[0].childNodes[0].nodeValue = sName;
gridView.rows[iRow].cells[1].childNodes[0].nodeValue = sCity;
gridView.rows[iRow].cells[2].childNodes[0].nodeValue = sState;
*/
}
--Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top