ASP.NET ComboBox - Initial Text




The items of the ComboBox can be loaded on-demand (via AJAX requests). The advantage of using this approach
is that the items are loaded only when the end user types something into the input field.
Thus, the page will load very fast because no item is loaded on page load.

In order to enable the on demand loading feature, set the EnableLoadOnDemand property to true.
You also need to handle the LoadingItems server-side event, which is executed each time the ComboBox
requests items from the server via AJAX. The server-side event handler will load all the items that match the text typed in the input field.

If you need to initially load the items that match a specific text, you need to use a ComboBoxItem that has its Text and Value
properties set to the initial text that you want to search for. Also, the Selected property of this ComboBoxItem needs to be set to true.

For this sample we set the initial text to "E", and thus upon opening the ComboBox, the countries starting with "E" are loaded.



« Back to examples