如何在datagrid的模板列中使用
一个dropdownlist的selectindexchanged事件?
请写出其方法!!
一个dropdownlist的selectindexchanged事件?
请写出其方法!!
解决方案 »
- 页面跳转到指定位置
- .net网站部署
- 安装VS2005时出现1402错误:无法打开注册表键
- 请高手给我个excel表导入SQL Server数据库中的源代码
- 有谁可以提供网上办公系统的模板、源码?
- Repeater数据源为空怎么办?
- 为什么我的asp.net软件发布的时候 在有的电脑上面drpdownlist显示不出来?
- 老问题,如何使SQLSERVER不能远程访问,就是不能在企业管理器,建立一个远程的注册?
- 大哥小问题不懂请帮个忙吧想不开拉@@!!~~!!!@~
- Server Error in '/' Application 什么问题 高手解答啊
- 这个啥意思啊?
- 如何让Button事件处理完数据后加一个弹出的提示框提示成功与否后在进入到目标页
如何获得这一行的itemindex呢?
就是说这一行的行号!!
我想用来更新一行!!
中说了怎么在触发DataGrid模板列中控件自己的事件,网友问怎么知道点击的是哪一行?要通过这个来获取中的信息。
那一行DataGridItem是
((DataGridItem)((DropDownList)sender).Parent) 吗?不是,因为((DataGridItem)((CheckBox)sender).Parent)是TableCell
其实应该是 ((DataGridItem)((DropDownList)sender).Parent.Parent) 接下来你想怎么就怎么了。 输出行号:
Response.Write(((DataGridItem)((DropDownList)sender).Parent.Parent).ItemIndex); 输出值:
Response.Write(((DataGridItem)((DropDownList)sender).Parent.Parent).Cells[0].Text);