RadComboBox for ASP.NET AJAX

RadControls for ASP.NET AJAX

RadComboBox provides its own Load-On-Demand mechanism. A poll-server timeout could be set, and RadComboBox fires a server-side event (ItemsRequested) which returns items based on the current text. RadComboBox also provides an option to cache the items loaded on demand. Starting from the Q1 2010 release, RadComboBox supports automatic (codeless) Load On Demand.

To use the Load-On-Demand mechanism, you need to:

  • Set the EnableLoadOnDemand property to True;

  • Do one of the following:

  • Subscribe to the ItemsRequested event and add new items to the RadComboBox.

    Note

    Items added in the ItemsRequested event handler are cleared when the next ItemsRequested event fires. If you, however, use the ShowMoreResultsBox mechanism or Virtual Scrolling the items will not be cleared upon clicking the ShowMoreResultsBox arrow or scrolling down.

  • Use the WebServiceSettings property so that RadComboBox loads the items from a Web Service.

When the user types in the input area or clicks on the drop-down toggle image when there are no items in the RadComboBox, the OnClientItemsRequesting event fires on the client, followed by an ItemsRequested event on the server. Once the new items have been added to RadComboBox, an OnClientItemsRequested event fires on the client.

Note

The EnableLoadOnDemand property allows the user to enter text in the input area, regardless of the value of the AllowCustomText property. This is because the load-on-demand mechanism requires the user to be able to enter text.

To specify a timeout (in milliseconds) before the server event is executed, use the ItemRequestTimeout.

Example

The ItemsRequested event handler shown below fills the RadComboBox with a set of items, loaded from a database. The items' text must match the string typed in the input area of the RadComboBox:

Load On Demand

Populate from a WebService

See Also