I have a ComboBox located in the ItemTemplate for a ListBox, and it was working fine prior to updating to the 2010 Quarter 1 Service Pack 1 version. Now, OnItemsRequested is not firing and I get an error saying "The target 'blah' for the callback could not be found or did not implement ICallbackEventHandler" when the control requests items.
If I move the ComboBox outside of the ItemTemplate, it works just fine. It's only when it's within the ListBox. Below is my code. By way of explanation, I'm doing it this way in order to show the the EmptyMessage, and then load the items after, so that it doesn't select the first item.
I did try registering the controls in Page_Load when it is a postback, because I found that advice in an older post, and FieldCombo_ItemsRequested still isn't hit, but I don't get the errors.
This seems to be the only issue with updating to this version within our application, so I'm really hoping to find a resolution, since this version is supposed to fix a different bug that we were having problems with.
If I move the ComboBox outside of the ItemTemplate, it works just fine. It's only when it's within the ListBox. Below is my code. By way of explanation, I'm doing it this way in order to show the the EmptyMessage, and then load the items after, so that it doesn't select the first item.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
<script type="text/javascript"> |
function LoadFieldCombo(sender, args) { |
sender.requestItems("", true); |
} |
</script> |
</telerik:RadScriptBlock> |
<telerik:RadDock ID="UserDefinedFieldsDock" runat="server" Title="User Defined Fields" |
DefaultCommands="ExpandCollapse" Width="100%" EnableDrag="false"> |
<ContentTemplate> |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> |
<telerik:RadListBox ID="FieldListBox" runat="server" Width="375" BorderStyle="None" AllowReorder="true" |
SelectionMode="Single" AllowDelete="true" OnDeleted="FieldListBox_Deleted" AutoPostBackOnDelete="true"> |
<ItemTemplate> |
<telerik:RadComboBox ID="FieldCombo" runat="server" EmptyMessage="Select a field" OnClientLoad="LoadFieldCombo" |
OnItemsRequested="FieldCombo_ItemsRequested" OnSelectedIndexChanged="FieldCombo_SelectedIndexChanged" /> |
<telerik:RadTextBox ID="FieldNameTextbox" runat="server" /> |
</ItemTemplate> |
<Items> |
<telerik:RadListBoxItem Value="1" /> |
<telerik:RadListBoxItem Value="2" /> |
</Items> |
</telerik:RadListBox> |
</telerik:RadAjaxPanel> |
</ContentTemplate> |
</telerik:RadDock> |
protected void FieldCombo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) |
{ |
RadComboBox combo = (RadComboBox)sender; |
combo.Items.Add(new RadComboBoxItem("Form_Type", "1")); |
combo.Items.Add(new RadComboBoxItem("Admit_Date", "2")); |
combo.Items.Add(new RadComboBoxItem("Admit_DX", "3")); |
combo.DataBind(); |
Page.Form.Controls.Add(combo); |
} |
I did try registering the controls in Page_Load when it is a postback, because I found that advice in an older post, and FieldCombo_ItemsRequested still isn't hit, but I don't get the errors.
This seems to be the only issue with updating to this version within our application, so I'm really hoping to find a resolution, since this version is supposed to fix a different bug that we were having problems with.