RadComboBox for ASP.NET AJAX
|Visual Studio version
all browsers supported by RadComboBox
This project demonstrates how to implement a RadComboBox
supporting multi-selection with checkboxes.
Briefly, I create an Item Template which holds a single ASP
CheckBox control. Whenever the user clicks on either the CheckBox or its Text the
onclick event is handled and the container RadComboBox Item is ‘recorded’. The
important step here is to maintain the state of the drop down – it should be
open while the user clicks on the Items.
Since RadComboBox selects only one Item by design, I use its
Input field to store the texts of the selected Items and a hidden field to store
their values. Both of them I store as a comma separated lists, which are easily
parsed on the server when needed. In the same manner Indexes of the selected
Items can be stored in additional hidden field if it is required.
RadComboBox has built-in checkboxes support from Q2 2011. A demo is available here.