AUTHOR: Peter Milchev
DATE POSTED: June 03, 2019
Clicking on an item does not check/uncheck items.
When clicking an item, the SelectedIndexChanged event is fired and the click does not bubble up to the Checkbox element.
To make the ListBox check/uncheck the checkbox when clicking anywhere on the item, we can prevent the selected index changed event and click the checkbox element programmatically.
<
telerik:RadListBox
runat
=
"server"
OnClientSelectedIndexChanging
"OnClientSelectedIndexChanging"
CheckBoxes
"true"
ID
"RadListBox1"
>
Items
telerik:RadListBoxItem
Text
"Item 1"
/>
"Item 2"
"Item 3"
"Item 4"
</
<script>
function
OnClientSelectedIndexChanging(sender, args) {
var
item = args.get_item();
item.get_checkBoxElement().click();
args.set_cancel(
true
);
}
</script>
Resources Buy Try