This is a migrated thread and some comments may be shown as answers.

RadComboBox very very slow

8 Answers 292 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Agi
Top achievements
Rank 1
Agi asked on 19 Apr 2012, 11:39 AM
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

8 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 19 Apr 2012, 12:24 PM
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.
0
Agi
Top achievements
Rank 1
answered on 20 Apr 2012, 06:33 PM
Hello Ivan,
  Many many thanks it worked.

Regards,
Agi
0
Rob
Top achievements
Rank 1
answered on 17 Mar 2014, 09:41 PM
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. 
0
Helen
Telerik team
answered on 18 Mar 2014, 12:03 PM
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.

 
0
Rob
Top achievements
Rank 1
answered on 18 Mar 2014, 02:51 PM
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
0
Helen
Telerik team
answered on 19 Mar 2014, 09:00 AM
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.

 
0
Ravi
Top achievements
Rank 1
answered on 09 Dec 2015, 04:47 AM

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.

0
Helen
Telerik team
answered on 09 Dec 2015, 07:47 AM
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
Tags
ComboBox
Asked by
Agi
Top achievements
Rank 1
Answers by
Ivan Zhekov
Telerik team
Agi
Top achievements
Rank 1
Rob
Top achievements
Rank 1
Helen
Telerik team
Ravi
Top achievements
Rank 1
Share this question
or