Reputation: 1093
I can't find the dropdown list on row updating: DropDown list is in EditTemplate
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlDataSource2.UpdateParameters.Clear();
string op = "1";
try
{
DropDownList ddl = GridView1.FindControl("ddlprioridade") as DropDownList;
op = ddl.SelectedValue.ToString();
}
catch { }
....
}
This ddl is allways null and i can't solve this!
Upvotes: 0
Views: 69
Reputation: 334
Have you tried this:
var dropDown = GridView1.Rows[GridView1.EditIndex].FindControl("ddlprioridade") as DropDownList;
Upvotes: 2