我知道如何获得事件 templatefield
内部的价值:RowDataBound
Control ctrl = e.Row.FindControl("Drop_Responsaveis");
DropDownList ddl = ctrl as DropDownList;
ddl.items.add(something);
但我需要在活动中获得它的价值button_Click
......我该怎么做?
@Siz S 答案的解决方案
foreach (GridViewRow gvr in GridView1.Rows)
{
string str = ""
Control ctrl = gvr.FindControl("Drop_Responsaveis");
if (ctrl != null)
{
DropDownList ddl = ctrl as DropDownList;
str= ddl.SelectedItem.ToString();
}
}