I have a scenario with multiple RadComboBoxes that don’t seem to fire the Itemsrequested server event prior to receiving the response from the previous callback. Here is a page that I wrote to show the problem. When the normal ASP.NET drop down changes indexes, it will make a callback that has a 5 seconds delay in it. If you press the drop down button for either of the RadComboBoxes during this time, it will display loading but never return. You have to click out of the combo box and then back in it to get the items to load.
RadComboBox 1 also has an onblur that calls an AJAX callback to a 5 second delay. If you try to drop down RadComboBox 2 during this delay, it will just show loading and not update.
Do you have any suggestion as to what might be causing this and how to get around it? Ideally the combo boxes will be able to either load during the callback or queue the request so that it will start when the previous callback is complete.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .RadComboBoxDropDown .rcbItem, .RadComboBoxDropDown .rcbHovered, .RadComboBoxDropDown .rcbDisabled, .RadComboBoxDropDown .rcbLoading { margin: 0 1px; padding: 2px 6px; white-space: pre; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:Label ID="lblDDL" Text="Drop Down 1" style="float:left;" runat="server"></asp:Label> <asp:DropDownList ID="DDLTest1" runat="server" style="float:left;" AutoPostBack="true" OnSelectedIndexChanged="DDLTest1_SelectedIndexChanged" > <asp:ListItem Text="apple" > </asp:ListItem> <asp:ListItem Text="orange" /> </asp:DropDownList> <br /> <br /> <asp:Label ID="lblrcb1" Text="RadComboBox 1" runat="server" style="float:left;" /> <telerik:RadComboBox ID="RadComboBox1" OnItemsRequested="RadComboBox1_ItemsRequested" style="float:left;" EnableLoadOnDemand="true" OnClientBlur="function(){$find('PageAjaxManager').ajaxRequest('RadComboBox1');}" EnableAjaxSkinRendering="true" ItemRequestTimeout="1000" runat="server"> </telerik:RadComboBox> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <asp:Label ID="lblrcb2" Text="RadComboBox 2" runat="server" style="float:left;" /> <telerik:RadComboBox ID="RadComboBox2" OnItemsRequested="RadComboBox2_ItemsRequested" style="float:left;" EnableLoadOnDemand="true" EnableAjaxSkinRendering="true" ItemRequestTimeout="1000" runat="server"> </telerik:RadComboBox> </div> <telerik:RadAjaxManager ID="PageAjaxManager" runat="server" RequestQueueSize="5" > <AjaxSettings> <telerik:AjaxSetting AjaxControlID ="DDLTest1" > <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="DDLTest1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> </form> </body> </html> using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; using Telerik.Web.UI; using System.Threading; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { DataTable dataTable = new DataTable(); dataTable.Columns.Add(new DataColumn("ID", typeof(string))); dataTable.Columns.Add(new DataColumn("Name", typeof(string))); DataRow dr = dataTable.NewRow(); dr["ID"] = "1"; dr["Name"] = Server.HtmlEncode("Name 1 2 3"); dataTable.Rows.Add(dr); DataRow dr2 = dataTable.NewRow(); dr2["ID"] = "2"; dr2["Name"] = "Name 2 4"; dataTable.Rows.Add(dr2); DataRow dr3 = dataTable.NewRow(); dr3["ID"] = "3"; dr3["Name"] = "1 Name 3"; dataTable.Rows.Add(dr3); if (o is RadComboBox) { (o as RadComboBox).DataSource = dataTable; (o as RadComboBox).DataTextField = "Name"; (o as RadComboBox).DataValueField = "ID"; (o as RadComboBox).DataBind(); } } protected void RadComboBox2_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { DataTable dataTable = new DataTable(); dataTable.Columns.Add(new DataColumn("ID", typeof(string))); dataTable.Columns.Add(new DataColumn("Name", typeof(string))); DataRow dr = dataTable.NewRow(); dr["ID"] = "1"; dr["Name"] = Server.HtmlEncode("Name 1 2 3"); dataTable.Rows.Add(dr); DataRow dr2 = dataTable.NewRow(); dr2["ID"] = "2"; dr2["Name"] = "Name 2 4"; dataTable.Rows.Add(dr2); DataRow dr3 = dataTable.NewRow(); dr3["ID"] = "3"; dr3["Name"] = "1 Name 3"; dataTable.Rows.Add(dr3); if (o is RadComboBox) { (o as RadComboBox).DataSource = dataTable; (o as RadComboBox).DataTextField = "Name"; (o as RadComboBox).DataValueField = "ID"; (o as RadComboBox).DataBind(); } } protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) { base.RaisePostBackEvent(sourceControl, eventArgument); if (sourceControl is RadComboBox || eventArgument == RadComboBox1.ClientID) { Thread.Sleep(5000); } } protected void DDLTest1_SelectedIndexChanged(object sender, EventArgs e) { Thread.Sleep(5000); } }