I have a Telerik RadComboBox that is programmatically generated in C#. In the aspx file, I have this JavaScript function which I would like to deselect any disabled comboBox item when the "Check All" choice is selected.
function OnClientCheckAllChecked(sender, args) {
var checkedItems = sender.get_checkedItems();
for (var i = 0; i < checkedItems.length; i++) {
console.log(checkedItems[i].get_text());
if (checkedItems[i].get_enabled() === false) {
console.log("enabled is false for " + i);
checkedItems[i].set_checked(false);
}
console.log("checked is " + checkedItems[i].get_checked());
}
}
However, it does not work as intended. The disabled item is still checked after clicking the "Check All".
Here is an image of the description:
Hi Eugene,
Currently, with our recent versions, the default behavior of the CheckAll functionality of the Combo is to check only the enabled items (disabled items are not being checked when check all is clicked). Could you please clarify if the behavior on your side is different and which version of Telerik controls are you using?
For your convenience, I have attached a basic sample for testing. It would be very helpful if you modify the sample so it replicates the problem you are facing and send it back to us for troubleshooting.
Hi Doncho,
thanks for the demo! I am using 2014.3.1024.40 of the Telerik Web UI dll.
After running your demo with the JavaScript code I posted originally, I could see that the script runs through only those items that were selected (ie disabled items were not selected). In my original case, the script had run through all items (enabled + disabled). Do you have any workaround for the older version of Telerik which I am using?