如何获取单元格中的文本框的gridview fron id的行索引 [英] how to get row index of gridview fron id of textbox in the cell

查看:48
本文介绍了如何获取单元格中的文本框的gridview fron id的行索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ..

我正在尝试在onpaste event.provide soltn.thanx

hi..

I am trying to access row index of gridview from current textbox in the cell id using javascript on onpaste event.provide soltn.thanx

推荐答案

.aspx代码上使用javascript从单元格ID中的当前文本框中访问gridview的行索引. >
< asp:textbox id ="txtUnit" runat ="server" text =<%#Bind(" unit)%& gt;" ="=" onpaste ="return cleanPhoneNumber(event,this);" xmlns:asp =#unknown">

javascript:

函数cleanPhoneNumber(e,txt){
var rowIndex = txt.offsetParent.parentNode.rowIndex;
var cellIndex = txt.offsetParent.cellIndex;
}
.aspx code:

<asp:textbox id="txtUnit" runat="server" text="<%# Bind(" unit")%&gt;"="" onpaste="return cleanPhoneNumber(event,this);" xmlns:asp="#unknown">

javascript:

function cleanPhoneNumber(e,txt) {
var rowIndex=txt.offsetParent.parentNode.rowIndex;
var cellIndex=txt.offsetParent.cellIndex;
}


为每行提供一个具有相同后缀的唯一ID.例如,
give every row an unique id with the same suffix. as exalple
<table><tbody><tr id="row_1"><td><input  önpasteventorwhatever="related_function(event,1)"></input></td></tr></tbody></table>

然后说话...


这篇关于如何获取单元格中的文本框的gridview fron id的行索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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