I wish to use a single RadListBox as a replacement for a CheckBoxListControl. I am only really interested in the Checked functionality of the listbox items. Their selected state is irelevant. Therefore, I would like to prevent the items from ever being "Selected" and force users to use the checkboxes. I found a handy example which allows me to check/uncheck the checkboxes if the user clicks on an item by handling the selectedindexchanged event:
var sema_used;
function listItemClicked_BSC(sender, eventArgs) {
if (!sema_used) {
sema_used = true;
var item = eventArgs.get_item();
if (item.get_checked()) {
item.uncheck();
}
else {
item.check();
}
item.set_selected(false);
sema_used = false;
}
}
However, even though I call item.set_selected(false), the item still apears to be highlighted in the listbox. I believe this is probably because the selectedindex does not always change when a user clicks on an item. Is there a way to make sure all items are unselected (unhighlighted) in a listbox. Or is there a way to disable item selectiong, but keep the checkbox functionality? Ideally, there should be a client-side event for ItemClicked and ItemClicking, rather than just the current SelectedIndexChanged.