Hi, I cannot get my SelectedIndexChanged of my dropdownlist to fire. I have the following:
<form id="form1" runat="server">
<div>
<asp:GridView id="grdPoll" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Text="Review" Value="Review" Selected="True">Review</asp:ListItem>
<asp:ListItem Text="Level1" Value="lvl1">Send Back to Level1</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblCity" runat="server" Text="Label"></asp:Label>
</div>
</form>
In my code behind I have this:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.lblCity.Text = ((DropDownList)sender).SelectedValue;
}
If I put this same ddl outside of the gridview, it fires.
The postback is occurring and the autopostback is set to true. The event just never fires. Why can't I get my event to fire from within the gridview?
Thank you.