ASP.NET ComboBox - Items with ASP.NET CheckBox Controls Loaded On-Demand
Displaying items 0-0 out of 0.
Loading ...
Order
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 or opens the drop down menu
(by clicking on the arrow button). 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.
To improve the performance even further, you can use the "paging" approach for the load on demand feature.
Using this approach will force the ComboBox to load only a limited number at a time, instead of retrieving all the matches at once.
So for example, if there are 10,000 items in the database, you can configure the ComboBox to load 100 items at a time,
to make the on demand loading functionality run smoother.
To load the next set of items, the end user simply needs to click on the footer text from the bottom of the list with items.
The items of the ComboBox can be customized using templates. You can embed any content inside an item template,
including HTML markup and ASP.NET server controls (any control from the Obout suite may be added to a template).
In order to set up an item template, use the
ItemTemplate
property of the ComboBox.
To extract data from the data item, use the
Eval
method which expects as a parameter
the name of the data field from which to load the data.
This example showcases the use of
ASP.NET CheckBox
controls inside the items, which are loaded on demand.
The end user is able to select any number of items by clicking on them or by checking the checkboxes.
« Back to examples