Javascript and the Datagrid
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.jscript.

Post a new message to this list...

John Hoffman
Hello,

I have a simple datagrid with 4 bound columns... say name, address, city, state. The datagrid gets populated from the server. I also have a button control on the form. When the user presses the button, I capture the onclick. I want the client code, (javascript) to iterate through the datagrid and read each row and be able to extract a column. Something like:

for( i= 0; i< document.form.Form1.DataGrid1.rows.count; i++)
{
var name = document.forms.Form1.DataGrid1[i]["name"].value;
}

Am I way off here????
Any help would be appreciated!!!

TIA,
John Hoffman

Reply to this message...
 
    
bruce barker
you are way off. the datagrid is rendered as a table. using the dom, a <tr>
represents a row, a <td> a col. check out the documentation for the html
dom.

-- bruce (sqlwork.com)

"John Hoffman" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

control on the form. When the user presses the button, I capture the
onclick. I want the client code, (javascript) to iterate through the
datagrid and read each row and be able to extract a column. Something like:
[Original message clipped]

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com