Hi friends,
I want to know How to drop down bind in grid view in asp.net ? Example with code.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 23, 2012, 2:10 PM
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