How to bind DropDownList box in gridvew edit mode with selected values.
DropDownList box in gridvew edit mode
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 11, 2011, 2:09 AM EST
Try below code:
protected void grdDevelopment_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList drpBuildServers; drpBuildServers = e.Row.FindControl("ddlBuildServers") as DropDownList; if (drpBuildServers != null) // Write your code here } }Thanks.
ShankeyRank #972 · 2.1K reputationPosted Feb 11, 2011, 2:15 AM EST
Have a look http://www.aspnettutorials.com/tutorials/controls/dropdownlist-gridview-csharp.aspx