如何获得列值在asp.net使用javascript中的GridView给定行?
问题描述:
我有一个GridView,我有一个JavaScript函数的行索引。现在,我想要得到使用JavaScript在GridView的索引列的值。
请告诉我,我该怎么办呢?
I have a GridView, I have a row index in a javascript function. Now I want to get the value of a Column for that index in a GridView using javascript. Please tell me how can I do this?
答
检查了这一点...
var tbl = document.getElementById('Gridview1');
var tbl_row = tbl.rows[parseInt(RowIndex) + 1];
var tbl_Cell = tbl_row.cells[no of the cell];
var value= tbl_Cell.innerHTML.toString();
下面无细胞
的表示列数。
如果它是一个模板字段,你可以试试这个。
If it is a template field,you can try this..
var value=document.getElementById('GridViewId_ColumnID_' + RowIndex).value;