我有两个 GridTemplateColumn(s),每个都包含一个 RadCombobox。当左侧组合框 OnSelectedIndexChanged 事件触发时,我需要根据左侧的新值重新填充右侧组合框。我似乎无法以任何方式从事件中找到 FindControl。
<telerik:GridTemplateColumn HeaderText="CAKE Verticals" ItemStyle-Width="100px">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="RadComboBox_CakeVerticals" EnableLoadOnDemand="True"
OnItemsRequested="RadComboBox_CakeVerticals_ItemsRequested" AutoPostBack="true"
HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px"
OnSelectedIndexChanged="RadComboBox_CakeVerticals_OnSelectedIndexChangedHandler">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="CakeColumns" HeaderText="CakeColumns" ItemStyle-Width="100px">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="RadComboBox_CakeColumns" EnableLoadOnDemand="True"
OnItemsRequested="RadComboBox_CakeColumns_ItemsRequested" AutoPostBack="true"
HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px"
OnSelectedIndexChanged="RadComboBox_CakeColumns_OnSelectedIndexChangedHandler">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
并且在 CS
protected void RadComboBox_CakeVerticals_OnSelectedIndexChangedHandler(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox combobox = (RadComboBox)RadGrid_Columns.FindControl("RadComboBox_CakeColumns");
Session["verticalID"] = e.Value;
RCB_CAKE_Columns_Populate(e.Value, combobox);
}
问题是组合框始终为空。