Hi friends,
I want to know How to drop down bind in grid view in asp.net ? Example with code.
Dropdown Bind In Grid View In Asp.Net
1 Answer
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
Satyapriya NayakRank #47 · 31.5K reputationPosted May 23, 2012, 10:10 AM EDT
Code is:
protected void ddl1_load(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter("select sno from student", cn);
DataTable dt = new DataTable();
da.Fill(dt);
DropDownList ddl = (DropDownList)sender;
ddl.DataSource = dt;
ddl.DataTextField = "sno";
ddl.DataValueField = "sno";
ddl.DataBind();
}
Please refer the below links
http://www.dotnetfunda.com/articles/article989-dropdownlist-in-the-gridview-keeping-aspnet-forms-control-in-gridview-.aspx.
http://asimsajjad.blogspot.in/2009/04/dropdownlist-binding-in-gridview-aspnet.html
Thanks