| 1 | NULL | InternetSites | NULL | True |
| 2 | NULL | Yahoo | 1 | False |
| 3 | www.yahoo1.com | Yahoo1 | 2 | False |
| 4 | www.yahoo2.com | Yahoo2 | 2 | False |
| 5 | NULL | 1 | False | |
| 6 | www.google1.com | Google1 | 5 | False |
| 7 | www.google2.com | Google2 | 5 | False |
| 8 | NULL | Services | NULL | True |
| 9 | NULL | IT | 8 | False |
| 10 | www.it1.com | it1 | 9 | False |
| 11 | www.it2.com | it2 | 9 | False |
| 12 | NULL | Infrastructure | 9 | False |
| 13 | www.infra1.com | infra1 | 12 | False |
| 14 | www.infra2.com | infra2 | 12 | False |
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.