Posted on: 7/31/2013 10:45:37 AM | Views : 236

hi.. in my grid view there are 2 dropdownlist, which have to populate from database. The 2nd one would be dependent on the value of the selected item of the 1st ddl. The SelecredIndexChange event of the 1st is fired though the 2nd ddl is not populated.....here is my code......
.cs file:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { scon.Open(); var ddl5 = (DropDownList)e.Row.FindControl("DropDownList5"); SqlCommand cmd1 = new SqlCommand("select distinct plantname,plantcode from PLANT_MASTER ", scon); SqlDataAdapter da1 = new SqlDataAdapter(cmd1); DataSet ds1 = new DataSet(); da1.Fill(ds1); ddl5.DataSource = ds1; ddl5.DataTextField = "plantname"; ddl5.DataValueField = "plantcode"; ...

Go to the complete details ...