void addControl() { foreach(GridViewRow row in GridView1.Rows) { int key=(int)GridView1.DataKeys[row.RowIndex].Value; if(row.RowType==DataControlRowType.DataRow) { DropDownList1=new DropDownList(); DropDownList1.DataSource=list; DropDownList1.DataBind(); string str=ht[key].ToString(); DropDownList1.SelectedValue=str; row.Cells[2].Controls.Add(DropDownList1); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)