EnableAutomaticLoadonDemand and caching

2 posts, 0 answers
  1. Ed Lance
    Ed Lance avatar
    61 posts
    Member since:
    Jun 2012

    Posted 19 Dec 2012 Link to this post

    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>
  2. Ed Lance
    Ed Lance avatar
    61 posts
    Member since:
    Jun 2012

    Posted 20 Dec 2012 Link to this post

    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.
Back to Top