RadComboBox with Multi-select

Create the radcombobox with muti-selection[CheckBoxList].

< telerik:RadComboBox ID="rcbCompetency" runat="server" Skin="Office2007"
DropDownWidth=”250″ Width=”250px”
OnClientDropDownClosed=”HandleClose”>

< asp:CheckBoxList ID="lstCompetencySkill"
runat=”server” BorderStyle=”None”>

Javascript :

function stopPropagation(e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
}

Display the selected items to the comboBox:

function HandleClose(comboBox) {
var selectedData = “”;
var items = comboBox.get_items();
for (var i = 0; i < items.get_count(); i++) {
var itemDiv = items.getItem(i).get_element();
var inputs = itemDiv.getElementsByTagName(“input”);
var inputsData = itemDiv.getElementsByTagName(“label”);
for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) {
var input = inputs[inputIndex];
if (input.type == “checkbox”) {
if (input.checked == true)
selectedData = selectedData + inputsData[inputIndex].innerText+”,”;
}
}
}
comboBox.set_text(selectedData.substring(0, selectedData.length – 1));
}

Advertisements

About ambilykk

I am a Technology Evangelist on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Azure and Visual Studio. Technology adoption and learning is my key strength and technology sharing is my passion.
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to RadComboBox with Multi-select

  1. sachin says:

    It’s really good one, thx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s