如何获取Access Gridview行列名? [英] how to get Access Gridview Row Column Name?

查看:56
本文介绍了如何获取Access Gridview行列名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var grid = document.getelementbyid('Gridname');





var text = grid.rows [1] .cells [1] .innerHTML;





这里代替Cells [1]我想使用像cell ['txt_Orderno']这样的东西;





in cell [1]我正在使用模板字段文本框;



该文本框的id是txt_Orderno。



所以我的问题不是使用单元格索引而是要使用绑定字段或模板字段id的列名。如何实现这一点???

var grid=document.getelementbyid('Gridname');


var text=grid.rows[1].cells[1].innerHTML;


Here instead of Cells[1] i want to use something like cells['txt_Orderno'];


in cell[1] i am using template field textbox;

the id of that textbox is txt_Orderno.

So my problem is instead of using index of cell i want use column name of bound filed or template filed id. How to achieve this???

推荐答案

您正在尝试客户端的服务器端方法,这将无法正常工作。 GridView将呈现为简单的HTML表格,因此一旦加载网格,请浏览渲染的html,然后相应地编码以访问所需的字段。



问候......
You are trying server side methods on client side which won't work. GridView will be rendered as simple HTML table so once the grid is loaded,go through the rendered html and then code accordingly to access the required fields.

Regards...


希望这个链接有用:



http://stackoverflow.com/questions/17081454/get-columns-name-or-header-text-of-gridview- using-javascript [ ^ ]
Hope this link will be helpful :

http://stackoverflow.com/questions/17081454/get-columns-name-or-header-text-of-gridview-using-javascript[^]


这篇关于如何获取Access Gridview行列名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆