This is a migrated thread and some comments may be shown as answers.

Checkboxes Select a single node only

1 Answer 251 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 11 Nov 2015, 10:23 AM

Hi all

Don't ask - operation reasons, but I have  rad combo box with checkboxes, is it possible to only allow a single checkbox to be selected?

A bit like turning off multiselect, which isn't a property.

Andy

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 16 Nov 2015, 08:22 AM
Hello Andy,

This behavior can be achieved by subscribing to the ComboBox' OnClientItemChecking client-side handler and canceling the event if the user tries to check more than one checkbox:
function OnClientItemChecking(sender, args) {
    var checkedItems = sender.get_checkedItems();
    var item = args.get_item();
 
    if (checkedItems.length >= 1 && !item.get_checked()) {
        args.set_cancel(true);
    }
}

Regards,
Ivan Danchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DropDownList
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Ivan Danchev
Telerik team
Share this question
or