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

Load more items.

1 Answer 61 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Needha
Top achievements
Rank 1
Needha asked on 28 Jun 2013, 02:22 AM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Jun 2013, 03:37 AM
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.
Tags
ComboBox
Asked by
Needha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or