gridview 在编辑状态下。模板列中的dropdownlist 如何触发事件啊?
解决方案 »
- 帮我看下这个 子查询有什么问题~~~~
- 如何触发gridview编辑状态下绑定控件的事件?
- 生成.html。看看我错在那了--高手指点
- 在网页中嵌入的media Player怎样能够实现多种视频格式播放
- 2005的一点疑惑
- 觅ASP.NET合作伙伴(北京)
- 如何用SqlCommand的ExecuteReader方法执行多个SQL语句&NextResult问题
- 如何返回记录数啊?
- 在ASP页面中设置一个按钮,如何实现IE浏览器中的上一步“后退”功能?
- 我的DataGrid中的按钮按下去没有反应,怎么办?
- asp.net登陆问题
- asp.net报“AccessViolationException”错误,求高手帮忙
TextBox txt = (TextBox)(editRow.FindControl("textBoxName"));//再赋值:
txt.Text = ddl.SelectedItem.Text;把DropDownList的AutoPostBack属性设置为true;
然后在SelectedIndexChange()事件中写.
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.FindControl("DropDownList1") != null)
{
DropDownList ddl =e.Row.FindControl("DropDownList1") as DropDownList;
ddl.DataSource = ds;
ddl.DataBind();
}
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow gvr = (sender as DropDownList).NamingContainer as GridViewRow;
if(gvr != null)
{
DropDownList ddl = gvr.FindControl("DropDownList1") as DropDownList;
if(ddl != null)
{
}
}
}