protected void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { con.Open(); var ddl = (DropDownList)e.Row.FindControl("ddsponcor"); string sponcorid = e.Row.Cells[0].Text; SqlCommand cmd = new SqlCommand("select sponcorid from Registration_Master where sponcorid=" + sponcorid, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); ddl.DataSource = ds; ddl.DataTextField = "sponcorid"; ddl.DataValueField = "sponcorid"; ddl.DataBind(); ddl.Items.Insert(0, new ListItem("--Select--", "0")); } }
DropDownList ddl = (DropDownList)e.Row.FindControl("ddsponcor");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)