Load more items.

2 posts, 0 answers
  1. Needha
    Needha avatar
    14 posts
    Member since:
    Mar 2013

    Posted 27 Jun 2013 Link to this post

    Hi

    I am loading a radcombobox from a huge sql datasource. I want to load 10 items and display a Load More text inside the combobox and clicking on it, the next 10 items will load. I need code to do this. Can anyone help?

    Thanks for replying,
    Needha
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jun 2013 Link to this post

    Hi Needha,

    You need the Automatic Load On Demand for the RadComboBox. Turn on load-on-demand mechanism by setting the EnableAutomaticLoadOnDemand property to True. From all the items withdrawn from the data source, RadComboBox filters only the ones which text match the text typed in the input area. It does this automatically. Optionally set either or both of the ShowMoreResultsBox and EnableVirtualScrolling properties to True to enable the respective features. What remains is, to tell the RadComboBox how many Items to load on each request by setting its ItemsPerRequest property to the desired value. The default is -1, which means that the control will load all items at once. 
    Please have a look at the following sample code I tried which works fine at my end.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" Height="200px" EmptyMessage="Select"
        ShowMoreResultsBox="true" ItemsPerRequest="10" EnableAutomaticLoadOnDemand="true"
        DataSourceID="SqlDataSource1" DataTextField="ProductName" DataValueField="ProductID">
    </telerik:RadComboBox>
    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ProductName], [ProductID] FROM [Products] ORDER By ProductName" />

    Thanks,
    Shinu.
Back to Top