$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ComboBox Feature Load On Demand in ASP.NET
Home > How to > ComboBox Load On Demand
In order to help users achieve faster performance when there are lots of items in the combobox, the asp.net ComboBox Control offers the load-on-demand feature which enables the Control to load items when you display the drop-down list or when you type certain text in the input area. And this article will mainly talk about the load-on-demand mechanism on server side.

Main Properties of Load-on-demand Feature

Here we list the main properties that will be used when applying the load on demand function in combobox.
  • Enable Automatic LoadOnDemand: after you set this property to true, you can use the load-on-demand functions and page the items in a quicker and easier way.
  • Enable Virtual Scrolling: if you set this property to true, the asp.net ComboBox Control will load items on portions even when you can are scrolling the drop-down list.
  • ShowMoreResultsBox: by default, the web ComboBox Control will load all the items at the first request. But you are allowed to request the Control to load items by certain number if you set the ShowMoreResultsBox property to true. Besides, after this property is set to true, the number of currently loaded items and the number of remain items will be displayed at the footer of the asp.net ComboBox Control. This property is often used especially when there are lots of items to be loaded. Note: when you use this property, you have to use the ItemsRequested event handler which returns items based on the current text.
  • ItemsPerRequest: this property is responsible for deciding how many items to load on each request by simply defining the value of ItemsPerRequest property. By default, the asp.net ComboBox Control will load all the items at once.

How to Use Load-on-demand Function

In this part, coupled with sample programming codes, we will guide you to use the combobox load on demand feature using ASP.NET AJAX step by step.
Bind data from other data source to combobox
<kettic:PerComboBox ID="PerComboBox1" runat="server" 
Height="180" Width="220"
DataSourceID="EntityDataSource1"
DataTextField="ContactName"
DataValueField="ContactName"
Label="EntityDataSource:">
</kettic:PerComboBox>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=NorthwindEntities"
DefaultContainerName="NorthwindEntities"
EntitySetName="Customers" Select="it.[ContactName]"
AutoPage="true" OrderBy="it.[ContactName]" />
Customize the attributes of load-on-demand feature
<kettic:PerComboBox ID="PerComboBox1" runat="server" 
Height="180" Width="220"
DataSourceID="EntityDataSource1"
DataTextField="ContactName"
DataValueField="ContactName"
EnableAutomaticLoadOnDemand="true"
ShowMoreResultsBox="true"
EnableVirtualScrolling="true"
ItemsPerRequest="10"
Label="EntityDataSource:">
</kettic:PerComboBox>
With above two steps, the load-on-demand function is enabled in combobox. Following image shows the result of above combobox load on demand activating application.

Other Recommended ComboBox Features

ASP.NET AJAX UI Controls