请问下各位,如果需要在GridView编辑行的情况下寻找中间的DropDownList,怎么找啊,用什么事件,用什么方法?
------解决方案--------------------------------------------------------
protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow gvr = GridView3.Rows[e.RowIndex];
Button btn = (Button)gvr.Cells[2].FindControl("Button2");
string str=btn.Text;//找到更新列中的按钮
string colName = GridView3.Columns[2].HeaderText;//获取更新列中的列名
Response.Write(colName);
}
------解决方案--------------------------------------------------------
GridView1_RowDataBound 事件中
DropDownList dl = (DropDownList)e.Row[行号].Cell[所在列].FindControl("DropDownListID");