I have cascading dropdowns in the Edit template of a RadGrid. When in edit mode, I populate both dropdowns with data correctly. However, when the first dropdown is changed, I want to repopulate the second. I have tried attaching the SelectedIndexChanged event of dropdown1 in the radgrid_itemcreated event and setting autopostback for dropdown1 to true. When I change dropdown1 the page does a post back but it never hits the ddlOUList_SelectedIndexChanged event handler. My grid is in a dynamically created user control in a content page which is in turn in a Master page. Why is the handler not catching? Any ideas?
Thanks,
Jayvr
<telerik:gridtemplatecolumn headerstyle-horizontalalign="Center" headertext="Operating Units" uniquename="colOperatingUnit">
<itemtemplate>
<asp:label id="lblOpUnit" runat="server" />
</itemtemplate>
<edititemtemplate>
<asp:dropdownlist cssclass="inputControlsNoWidth" id="ddlEditOUs" autopostback="true" runat="server" />
</edititemtemplate>
</telerik:gridtemplatecolumn>
<telerik:gridtemplatecolumn headerstyle-horizontalalign="Center" headertext="Responsibility" uniquename="colResponsibility">
<itemstyle width="30%" horizontalalign="Left" />
<itemtemplate>
<asp:label id="lblResp" runat="server" />
</itemtemplate>
<edititemtemplate>
<asp:dropdownlist cssclass="inputControlsNoWidth" id="ddlEditResp" runat="server" />
</edititemtemplate>
</telerik:gridtemplatecolumn>
void rgOUList_ItemCreated(object sender, GridItemEventArgs e)
{
if((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
{
DropDownList ddlOUList = (e.Item as GridEditableItem).FindControl("ddlEditOUs") as DropDownList;
if(ddlOUList != null)
{
ddlOUList.SelectedIndexChanged +=
new EventHandler(this.ddlOUList_SelectedIndexChanged);
}
}
}