RadComboBox very very slow

9 posts, 0 answers
  1. Agi
    Agi avatar
    3 posts
    Member since:
    Oct 2011

    Posted 19 Apr 2012 Link to this post

    Hello, theres,
      I use combobox to show about 3000 items, the performance is bad.  Any  idea?
      my code default.aspx.cs follows
    using System;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
      
    using System.Data;
    using System.Configuration;
    using System.Web.Security;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Telerik.Web.UI;
      
    public partial class Default : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
      
        }
        protected void Customer_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            for (int i = 0; i < 3000; i++)
            {
                Customer.Items.Add(new RadComboBoxItem("item " + i, "1"));
            }
        }
    }

    my default.aspx follows
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
                    //Put your JavaScript code here.
            function LoadCustomer(sender, eventArgs) {
                var CustomerCombo = $find("<%=Customer.ClientID%>");
                CustomerCombo.clearSelection();
                CustomerCombo.requestItems("", false);
            }
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        </telerik:RadAjaxManager>
        <div>
            <telerik:RadComboBox ID="SalesList" Runat="server" onclientselectedindexchanging="LoadCustomer">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />
                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" />
                </Items>
            </telerik:RadComboBox>
              
              
            <telerik:RadComboBox ID="Customer" runat="server" onitemsrequested="Customer_ItemsRequested" >
            </telerik:RadComboBox>
        </div>
        </form>
    </body>
    </html>

    about 8 seconds  for 2999 items in IE 8, but seems ok  in Chrome. How to solve  the problem ?

    Regards,
    Agi
  2. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 19 Apr 2012 Link to this post

    Hello, Agi.

    I would say that what you are seeing it's quite normal. After all, 3000 items would have approximately  the following footprint:

    25 bytes just for the items,
    5 bytes for the base text
    1 to 4 bytes for the counter text.

    As well as some JSON data.

    Multiply by 3000 and you are close more than 100 kb of postback content.

    Old browsers, especially IE6, 7 and 8 are notoriously slow with that much content. Also, that content needs to be parsed to HTML elements and all JS things set.

    Chrome on the other side is extremely fast and a the 100kb of content will not slow it down that much.

    In order to solve this, you could use virtual scrolling and not return the entire set of data. You can read this help article on virtual scrolling to get the general idea -- http://www.telerik.com/help/aspnet-ajax/combobox-load-on-demand-showmoreresultsbox.html.

    Regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Agi
    Agi avatar
    3 posts
    Member since:
    Oct 2011

    Posted 20 Apr 2012 Link to this post

    Hello Ivan,
      Many many thanks it worked.

    Regards,
    Agi
  5. Rob
    Rob avatar
    2 posts
    Member since:
    Nov 2010

    Posted 17 Mar 2014 in reply to Ivan Zhekov Link to this post

    I ran into the same problem.  If you don't need the bells and whistles of the RadComboBox then the good old  ASP DropDownList is much faster with large lists.  I have a list of 3000 names and it took the RadComboBox about 30 seconds to display and the DropDownlist is instant. The down side is you loose all the niceties of the Rad Control. 
  6. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 18 Mar 2014 Link to this post

    Hi all,

    You may also use the RadDropDownList instead of the RadComboBox.


    Regards,
    Helen
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  7. Rob
    Rob avatar
    2 posts
    Member since:
    Nov 2010

    Posted 18 Mar 2014 Link to this post

    Yes.  I just changed it to RadDropDownList.  With 3000 items it works just as fast as ASP DropDownList.  I guess now the question is why is the RadComboBox so slow but RadDropDownList does what I need.

    Thanks
  8. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 19 Mar 2014 Link to this post

    Hello Rob,

    RadComboBox combines many functionalities in one control - it may be divided into 3 separate controls - autocomplete, search and dropdown list. That's why its javascript is heavy.


    Regards,
    Helen
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  9. Ravi
    Ravi avatar
    9 posts
    Member since:
    Jul 2014

    Posted 08 Dec 2015 in reply to Helen Link to this post

    Then what about the Filter. i have to use Filter to type. I have also the same prblm and my list is approx is about 14k. I used so many methods but the results are same.

    Hope u understand i am trying to understand. so can u suggest what control from Telerik bucket i can use to bind approx 14k data and criteria for searching is just like auto completed. can u tell me.

  10. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 09 Dec 2015 Link to this post

    Hi Ravi,

    You may try the AutoCompleteBox:

    http://demos.telerik.com/aspnet-ajax/autocompletebox/examples/default/defaultcs.aspx

    If you set the MinFilterLength - it will reduce the returned results and the response time.

    Regards,
    Helen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017