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

combo search extremely slow with 1000 entries.

6 Answers 361 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
aykut
Top achievements
Rank 1
aykut asked on 13 Oct 2011, 09:41 AM
Dear friends,

I tried to use 2 column radcombobox with "product name" and "product code". data filed is ID column. For 50 or 100 records its fine. but 1000 entries and 2 column are killing people on local computer and also on server. I tried to implement  "google like" search, as you type web service would list available products, I succeeded but its also slow and some client computers says:

Windows Internet Explorer
---------------------------
Stop running this script?

A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become
unresponsive.


I dont know why this message appears but, at the moment I dont care. All I need to solve is 2 column searchable fast combobox. I also tried to use regular radcombo with 1 column only (productname) its also slow, even while dropping down.

Can someone confirms this situation is normal ? What kind of searchable THING should I use. Is the radcombobox wrong component for this ?

best regards.

heres the code:

                <telerik:RadComboBox ID="cboProducts" runat="server"
                    DataSourceID="SqlDataSourceProducts" DataTextField="productname"
                    DataValueField="guidid" Filter="StartsWith">
                </telerik:RadComboBox>
    <asp:SqlDataSource ID="SqlDataSourceProducts" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringNET %>"
        ProviderName="<%$ ConnectionStrings:ConnectionStringNET.ProviderName %>" DataSourceMode="Dataset"
        EnableCaching="true"
        SelectCommand="SELECT guidid, [productname], productcode FROM productsORDER BY [productname]">
        <SelectParameters>
        </SelectParameters>
    </asp:SqlDataSource>

6 Answers, 1 is accepted

Sort by
0
aykut
Top achievements
Rank 1
answered on 13 Oct 2011, 09:45 AM
Dear friends,

now I tried to use aspnet dropdownlist and is extremely fast. only it has no search function..

<asp:DropDownList ID="cboUrunler" runat="server"
                    DataSourceID="SqlDataSourceUrunler" DataTextField="urunadi"
                    DataValueField="guidid" Height="16px" Width="190px">
                </asp:DropDownList>

radcombo cannot be so slow, obviously I make something wrong.

any suggestions please ?
0
Shinu
Top achievements
Rank 2
answered on 13 Oct 2011, 10:21 AM
Hello Aykut,

The best approach to optimize the performance speed of Telerik RadComboBox when using huge amount of items is using the load-on-demand feature.  The load-on-demand mechanism loads the items only when the user types or clicks in the field or the drop-arrow image. It filters the Items server-side before they are loaded in the control and the Filter feature performs filtering at client-side.
http://www.telerik.com/help/aspnet-ajax/combobox-optimize-speed.html

And I recommend you to retrieve data in portions - with use of ShowMoreResultsBox and VirtualScrolling options.

Take a look at the this demo which demonstrates the various Load On Demand Modes.

Thanks,
Shinu.
0
aykut
Top achievements
Rank 1
answered on 13 Oct 2011, 11:44 AM
sorry, I already tried them. I'm searching telerik forums and found a post that when loading page at first time, whole items not loaded. this is called "lazy load" I believe. I experimented that first search takes long time. but after that radcombo is very responsive.

but unfortunatelly I could not succeeded to run sample codes to load entire items. can you help me please ? it seems get_items() method does not exists.

    <script type="text/javascript">
        function pageLoad() {
            var combo = $find('cboUrunler');
            var comboItems = combo.get_items();
        }
    </script>

where should I put this function ? I inserted at the end of page but no luck. I put in radcombo tags like OnClientLoad ="pageLoad" and changed function like this bu no luck.
    <script type="text/javascript">
        function pageLoad(sender, eventArgs) {
            sender.get_items();
        }
    </script>
0
Dimitar Terziev
Telerik team
answered on 17 Oct 2011, 11:31 AM
Hello Aykut,

In case you are using the load on demand mechanism the get_items() method should not return anything since there are no items in the combobox on initial load.

Please try to clarify what is the exact implementation that you are using.

Kind regards,
Dimitar Terziev
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
aykut
Top achievements
Rank 1
answered on 17 Oct 2011, 12:12 PM
Dear Terziev,
I dont have any implementation. I tried everything and could not succeed. I experimented every sample in telerik demos. web services, direct database connections, getting database fields into array....

I switched to aspnet dropdownlist as I needed urgent solution.

all I need is populating 2 column combobox with 1000 records and search (select) among them while user typing. this should not be so tricky and as long as dropdownlist and ajax search extenders works well, I believe radcombo search functionality have some limitations with 1000 records. dropdown list works in the blink of eye.

If you have a known working example that have 2 COLUMN combobox with 1000 items and search functionality, I can use it.

thanks for your time.
0
Dimitar Terziev
Telerik team
answered on 20 Oct 2011, 08:20 AM
Hello Aykut,

The idea behind the load on demand is to load items based on the text entered in the input of the combobox. Meaning that only relevant to the user data will be loaded, and not all of the content. In your case you should not load 1000 items, but only part of them based on some criteria.

Here you could find a demo showing such approach. The important part is this one:
SqlDataAdapter adapter = new SqlDataAdapter("SELECT * from Customers WHERE CompanyName LIKE @text + '%'",
               ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
           adapter.SelectCommand.Parameters.AddWithValue("@text", text);

as you could see only items with text similar to the one entered in the input will be loaded.

Additionally you could use Virtual Scrolling in order to load a fixed amount of items per request as Shinu has suggested.

All the best,
Dimitar Terziev
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
Tags
ComboBox
Asked by
aykut
Top achievements
Rank 1
Answers by
aykut
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Dimitar Terziev
Telerik team
Share this question
or