On Demand Loading

6 posts, 0 answers
  1. Courtenay
    Courtenay avatar
    22 posts
    Member since:
    Oct 2007

    Posted 07 Feb 2013 Link to this post

    Hi there,

    I have a huge set of data which i need to bind to on demand (on keystroke). Im currently using the AutoCompleteBox in SharePoint which won't allow me to call a webservice in the style that you suggest due to the security within SharePoint:

    <WebServiceSettings Path="/_layouts/SP.SyncMatrix/GetSiteData.aspx" Method="GetSites" />

    Since you don't allow a client side method of databinding, i was wanting to know if this is the only way of doing on-demand code behind (server side) bind. I did see that there is a ontextchanged method, is there an opportunity to rebind the datasource there?

    If not, is there anyway to modify the POST request that your control sends before it is sent? there is the client side onrequesting method but that doesnt seem to allow me to modify the post data at all.

  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 13 Feb 2013 Link to this post

    Hello Courtenay,

    In fact RadAutoCompleteBox uses server-side Load On Demand internally, it is a built-in feature.
    So you do not need to implement anything in order to use server-side Load On Demand - simply databind the control.
    Here you can find more details about RadAutoCompleteBox databinding.

    Greetings,
    Kalina
    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. Kiran
    Kiran avatar
    9 posts
    Member since:
    Jan 2010

    Posted 16 Dec 2013 Link to this post

    Hello Courtenay,

    I don't think loadondemand handles internally by AutoCompleteBox.

    Here is the sample code, I have 40 k records (employee names) in datasource. However it hangs to search for filter 'a' . Am I mistaking somewhere ? How to achieve load on demand behavior like combobox in RadAutoCompleteBox. ?

    -----------------Code

    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DropDownWidth="500px"

        OnDataSourceSelect="RadAutoCompleteBox1_DataSourceSelect" DataSourceID="ObjectDataSource2"    AllowCustomEntry="false"

        DataValueField="Value"     DataTextField="Text"     onclientitemsrequesting="OnClientItemsRequesting"   RegisterWithScriptManager="true" 

            Width="300px" >

    </telerik:RadAutoCompleteBox>

    protected void RadAutoCompleteBox1_DataSourceSelect(object sender, Telerik.Web.UI.AutoCompleteBoxDataSourceSelectEventArgs e)


    {


    var dataSource = e.DataSource as ObjectDataSource;

    if (dataSource != null)


    {


    dataSource.SelectParameters["SearchString"].DefaultValue = e.FilterString;


    }

    }


    Best Regards,

    Kiran

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Dec 2013 Link to this post

    Hi Kiran,

    Please have a look into the sample code snippet which woks fine at my end.

    ASPX:
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DropDownWidth="500px"
        OnDataSourceSelect="RadAutoCompleteBox1_DataSourceSelect" DataSourceID="ObjectDataSource2"
        DataTextField="text" Width="300px" AllowCustomEntry="false" RegisterWithScriptManager="true">
    </telerik:RadAutoCompleteBox>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="Class1">
        <SelectParameters>
            <asp:Parameter Name="textvalue" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    C#:
    protected void RadAutoCompleteBox1_DataSourceSelect(object sender, AutoCompleteBoxDataSourceSelectEventArgs e)
    {
            RadAutoCompleteBox1.DataSourceID = "ObjectDataSource2";
            ObjectDataSource2.SelectMethod = "GetData";
            ObjectDataSource2.SelectParameters["textvalue"].DefaultValue = e.FilterString;
    }

    Thanks,
    Shinu.
  6. Kiran
    Kiran avatar
    9 posts
    Member since:
    Jan 2010

    Posted 17 Dec 2013 Link to this post

    Hi Shinu,

    I did the same, it works fine for less records. However, it hangs out for large records.

    It should behave like RadComboBox load on demand, it should fetch next 10 records after click on dropdown scroll or navigating items.

    Best Regards,

    Kiran

     

  7. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 20 Dec 2013 Link to this post

    Hello Kiran,

    Regarding the large amount of data, which is contained in the underlying datasource of the RadAutoCompleteBox the operation would be inevitably slow. However, as you are able to handle and alter the query to your DataBase, you could simply request for the TOP 100 results for example. Thus, you could significantly decrease the returned data and optimize the process.

    Regards,
    Nencho
    Telerik
    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 the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017