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

EnableAutomaticLoadonDemand and caching

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ed Lance
Top achievements
Rank 1
Ed Lance asked on 20 Dec 2012, 01:33 AM
I tried the EnableAutomaticLoadonDemand technique and it works basically well.  One thing though, I thought it was supposed to cache the full result from the database if I set EnableItemCaching. I ran a SQL Profiler trace and it reruns the query each time, which causes slowness in non-local situations.  The combo does need to post after the user selects something, so the app can continue with the selection they chose.  Is there something else I need to do?

Thanks.

<telerik:RadComboBox ID="CaseRadComboBox" runat="server" DataSourceID="CaseSqlDataSource" DataTextField="FullCaseName" DataValueField="subIdx" enableautomaticloadondemand="true"
    enablevirtualscrolling="true" itemsperrequest="15" Filter="Contains" Width="400px" AutoPostBack="True" enableitemcaching="True" >
</telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Ed Lance
Top achievements
Rank 1
answered on 21 Dec 2012, 12:29 AM
I think I figured out what is going on here. If you enable caching, that appears to happen on the client side, and caches a previously typed result.  But if the combo box makes an ajax request, then the datasource is run again.

So for example, the user types '1001' in the combo box.  A search is done, the database hit, and some possible values are returned to the page.  Then the user hits the backspace key once, leaving a value of '100'.  The database is hit again.  Then the user types a '1' so the value is once again '1001', and that time the database is not hit because a search with that string was already done.  Telerik can correct me if I'm wrong on that, but that's what I see happening.

Anyways, this technique is just too intensive if you are searching larger amounts of data.  The table I'm hitting has over 6000 possible rows, which isn't that huge, but was causing slowness.  I changed over to using a web service way of getting rows and it is much faster.
Tags
ComboBox
Asked by
Ed Lance
Top achievements
Rank 1
Answers by
Ed Lance
Top achievements
Rank 1
Share this question
or