Hello,
sorry for late reply because busy work/job not able to give reply early.
<telerik:RadCodeBlock ID=
"RadCodeBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
function
HeaderCheckChanged(chkbx, combo) {
var
headerchk = chkbx.checked;
combo = $find(
"<%= RadComboBoxWithCheckbox.ClientID %>"
);
cancelDropDownClosing =
true
;
//holds the text of all checked items
var
text =
""
;
//holds the values of all checked items
var
values =
""
;
//get the collection of all items
//enumerate 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"
+ i +
"_chkddlID"
);
chk1.checked = headerchk;
if
(chk1.checked) {
text += item.get_text() +
", "
;
values += item.get_value() +
","
;
}
}
//remove the last comma from the string
text = removeLastComma(text);
values = removeLastComma(values);
if
(text.length > 0) {
//set the text of the combobox
combo.set_text(text);
}
else
{
//all checkboxes are unchecked
//so reset the controls
combo.set_text(
""
);
}
}
function
onCheckBoxClick(chk, combo) {
combo = $find(
"<%= RadComboBoxWithCheckbox.ClientID %>"
);
cancelDropDownClosing =
true
;
var
text =
""
;
var
values =
""
;
var
items = combo.get_items();
for
(
var
i = 0; i < items.get_count(); i++) {
var
item = items.getItem(i);
var
chk1 = $get(combo.get_id() +
"_i"
+ i +
"_chkddlID"
);
if
(chk1.checked) {
text += item.get_text() +
", "
;
values += item.get_value() +
","
;
}
}
text = removeLastComma(text);
values = removeLastComma(values);
if
(text.length > 0) {
combo.set_text(text);
}
else
{
combo.set_text(
""
);
}
}
function
removeLastComma(str) {
return
str.slice(0, -1);
}
function
StopPropagation(e) {
e.cancelBubble =
true
;
if
(e.stopPropagation) {
e.stopPropagation();
}
}
</script>
</telerik:RadCodeBlock>
let me know if any concern.
Thanks,
Jayesh Goyani