📜  如何从 GridView 中的下拉列表中获取所选项目 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:40.437000             🧑  作者: Mango

代码示例1
protected void LinkButton1_Click(object sender, EventArgs e)
{
  LinkButton lnkBtn = (LinkButton)sender;
  GridViewRow row = (GridViewRow)lnkBtn.NamingContainer;
  DropDownList ddl= (DropDownList)row.FindControl("DropDownList1");
  TextBox1.Text = ddl.SelectedValue.ToString();
}