我在gridview中有一个下拉列表和一些文本框,并且从数据库值中绑定了DDL,我必须添加具有相同DDL和文本框的新行,但是当创建新行时如何绑定DDL?
You can add the new row in GridView
Footer. During RowDataBound
event you can find the DDL and Bind the data,
protected void gv1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
DropDownList ddlName= (DropDownList)e.Row.FindControl("dlstName");
// You can bind data to ddlName
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.