Hi Team,
I have a combo box like this and client function as shown below.
<telerik:RadComboBox ID="cmbCurrency" runat="server" CausesValidation="false" ClientIDMode="AutoID"
EmptyMessage="[Select All]" Filter="Contains" MaxHeight="150" Width="100%" HighlightTemplatedItems="true"
AllowCustomText="true" OnClientDropDownClosed="onDropDownClosing">
<ItemTemplate>
<div onclick="StopPropagation(event)" >
<asp:CheckBox runat="server" ID="cbxItem" Text='<%# Eval("CurrencyCode") %>' onclick="onCheckBoxClick(this,'cmbCurrency')"/>
</div>
</ItemTemplate>
</telerik:RadComboBox>
//<Combo box 2 with same onclick event >
Onclick Event:
function onCheckBoxClick(chk, val) {
var combo = $find("ctl00_MainContent_radDockSelection_C_ctl00_" + val);
//prevent second combo from closing
cancelDropDownClosing = true;
//holds the text of all checked items
var text = "";
//get the collection of all items
var items = combo.get_items();
for (var i = 0; i < items.get_count(); i++) {
var item = items.getItem(i);
//get the checkbox element of the current item
var chk1 = $get(combo.get_id() + "_i" + 0 + "_cbxItem");
var chk2 = $get(combo.get_id() + "_i" + i + "_cbxItem");
if (chk.nextSibling.innerHTML != "[Select All]") {
chk1.checked = false;
if (chk2.checked == true)
text += chk2.nextSibling.innerHTML + ", ";
}
else {
if (chk1.checked == true)
text = "[Select All]";
chk2.checked = false;
chk1.checked = true;
}
}
text = removeLastComma(text);
if (text.length > 0) {
//set the text of the combobox
combo.set_text(text);
combo.ToolTip = text;
}
}
There were 2 problems
1) Check boxes was not responsive.i.e they are not allowing to check either. I change clientstateId as AutoId then It worked.
2) Check all seems not working.
Please let me know How to fix this.
Note : the code recently migrated to dotnet 4 and hosted in windows 2008 r2 .
Thanks in Advance.
Krish