问题描述
各位高手:我在GridView控件添加了模板列,然后在该模板列的HeaderTemplate中添加了DropDownList控件.希望在程序中访问该DropDownList控件,怎样用?请指教,谢谢!
解决方案
解决方案二:
request
解决方案三:
你在什么事件中取值?可以用FindControl去找
解决方案四:
DropDownListddl1=(DropDownList)this.GridView1.HeaderRow.FindControl("DropDownList1");Response.Write(ddl1.SelectedValue);
解决方案五:
楼上正解
解决方案六:
引用3楼cpp2017的回复:
DropDownListddl1=(DropDownList)this.GridView1.HeaderRow.FindControl("DropDownList1");Response.Write(ddl1.SelectedValue);
解决方案七:
引用5楼ljqingas的回复:
引用3楼cpp2017的回复:DropDownListddl1=(DropDownList)this.GridView1.HeaderRow.FindControl("DropDownList1");Response.Write(ddl1.SelectedValue);
解决方案八:
HeaderRow
时间: 2024-08-03 22:51:35