如何获得列值在asp.net使用javascript中的GridView给定行? [英] How to get Column Value for a given Row within GridView using javascript in asp.net?
本文介绍了如何获得列值在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;
这篇关于如何获得列值在asp.net使用javascript中的GridView给定行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文