选择dropdwn上获取特定的asp.net表格单元格 [英] get specific asp.net table cell on dropdwn selected
本文介绍了选择dropdwn上获取特定的asp.net表格单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我创建了asp.net表并将其与数据库表绑定。它有四个colms和一个下拉列表。
现在从数据库asp.net表中获取数据后显示了5个结果。
我想要的是如果用户更改3行中的dorpdown值,它应该获得第3行的所有单元格值。
我该怎么办呢。
请帮帮我
谢谢
Hi!
i have created asp.net table and bind it with database table. it has four colms and 1 dropdown.
now after getting data from database asp.net table has shown 5 results.
what i want is that if user change dorpdown values in the 3 row, it should get all the cells values of that 3rd row.
how can i do that.
Please help me out
Thanks
推荐答案
asp.net表不是数据控件。我想你在谈论asp:GridView
你可以使用onselectedindexchanged
事件在下拉列表中,然后得到相应的gridview行索引,这样
asp.net Table is not data control. I think you are talking aboutasp:GridView
you can useonselectedindexchanged
event in dropdown and then get the corresponding gridview row index like this
DropDownList ddl = (DropDownList)sender;
GridViewRow row = (GridViewRow)ddl.Parent.Parent;
int idx = row.RowIndex;
来自here>>
和更多示例
如何选中Gridview下拉列表索引已更改
从GridView控件中提升DropDownList SelectedIndexChanged
jQuery:
jQuery:
function cbo_selectedIndexChanged() {
var row =
( this )。nearest( tr);
// 你得到整行,你可以通过 $访问td值b $ b // row.cells collection
(this).closest("tr"); //you get whole row, you can access td values via //row.cells collection
这篇关于选择dropdwn上获取特定的asp.net表格单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文