views:

31

answers:

1

Datagrid is in content,When trying to access client side function for the cells in the datagrid,its always showing at 0 position suppose i have 10 rows,for each row "Test button" i should invoke the client side java script. For each row "Test button" client side script is displaying message at first row only.

in datagrid i am binding the description and button to every row in datagrid

so i have added Testbutton.attributes.add("onclick","return javascriptfunction();"); in datagrid_itembound.Iam showing one div in client side function but that is working only for one row,when iam trying to click test button in second row,its showing that div in first row instead of second row

i want similar functunality like displaying of flag button in stackoverflow.

A: 

The datagrid/gridview results in a table. You could get the table by it's ID using getElementById use getElementsByTagName to get the rows/columns and/or use jQuery to help do it for you.

The below links should help:

http://www.thescarms.com/dotnet/webdatagrid.aspx

http://forums.asp.net/p/1520596/3652832.aspx

http://www.vbforums.com/showthread.php?t=429055

http://www.netomatix.com/development/gridviewclientsideaccess.aspx

This last one uses jquery...

http://aspdotnetcodebook.blogspot.com/2010/01/how-to-get-cell-value-of-gridview-using.html

klabranche