ASP.NET ComboBox - Items with ASP.NET CheckBox controls

Order


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.
The end user is able to select any number of items by clicking on them or by checking the checkboxes.
You can easily detect at the server-side which items were selected, by looping through the items,
extracting the CheckBox control for each item (using the FindControl method) and analyzing
its Checked property to see whether the item was selected or not.



« Back to examples