Hi
I guess you are able to load data into your first dropdown list.
If not try to use row data bound event to load the data in the 1st dropdownlist,
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DropDownList ddlone=e.Row.FindControl("ID of the 1st dropdownlist ") as DropDownList;
// assign the datasource here then databind.
}
Now in the ASPX page from for the 1st dropdownlist try to set the autopostback property to true.
then add selectedindex changed event handler like
AutoPostBack="true" OnSelectedIndexChanged="cmb_SelectedIndexChanged"
in the code behind file
protected void cmb_SelectedIndexChanged(object sender, EventArgs e)
{
int currentindex = ((GridViewRow)((Control)sender).Parent.NamingContainer).RowIndex;
DropDownList ddltwo=GridView1.Rows[currentindex ].FindControl("ID of the 2nd dropdownlist ") as DropDownList;
// assign the datasource for the 2nd one here then databind.
}
Thanks,
Debata
mcanarendrachoudhary-10608, if this helps please login to Mark As Answer. | Alert Moderator