- (转)在GridView中 绑定DropDownList并回发事件
- RowBond中:
- DropDownList ddl = ((DropDownList)e.Row.Cells[7].FindControl("ddl_qu"));
- for (int i = 1; i < 11; i++)
- {
- ddl.Items.Add(new ListItem(i.ToString(), i.ToString()));
- }
- ddl_qu_SelectedIndexChanged:
- DropDownList Type = sender as DropDownList;
- TableCell cell = (TableCell)Type.Parent;
- GridViewRow item = (GridViewRow)cell.Parent;
- using (DBManage db = new DBManage())
- {
- string sql = "update t1 set c1='" +
- Type.SelectedValue + "' where deleted=0 and ID='" + item.Cells[0].Text + "'";
- //Response.Write(sql);
- if (db.ExecuteNonQuery(sql) > 0)
- {
- gridviewshow(str); //重新邦定
- }
- }
(转)在GridView中 绑定DropDownList并回发事件
最新推荐文章于 2025-04-08 19:09:39 发布