博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gridview单元格中获取行索引。。。
阅读量:7198 次
发布时间:2019-06-29

本文共 1687 字,大约阅读时间需要 5 分钟。

在gridview中放入个dropdownlist 然后我想实现 点击  

dropdownlist 的selectindexchange 事件中获取   

gridview的行索引 

 

 

如图 

 HTML前台代码 

请选择
借出
租出
毁损
盘亏

后台获取行索引:

protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)     {
int i; var dropDown = sender as DropDownList; TableCell cell = null; if (dropDown != null) {
cell = dropDown.Parent as TableCell; var row = cell.Parent as GridViewRow; i = row.RowIndex; string guid = GridView3.Rows[i].Cells[1].Text;//获取当前行的guid if (dropDown.SelectedValue == "借出") {
Response.Write(" "); } } }

 

转载于:https://www.cnblogs.com/smile-wei/archive/2012/03/30/2425295.html

你可能感兴趣的文章