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

telerik radcombobox Multiselect Checkbox, unchecking a Checkbox hide div

1 Answer 357 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sendhil
Top achievements
Rank 1
Sendhil asked on 25 Oct 2018, 05:33 AM

I have radcombobox with multiple selection of check boxes, by unchecking a checkbox i am trying to hide a div which has radgrids inside. And further making  the user to click on a button to show the div again with the remaining selected radcombobox items and bind radgrid data depending upon the selection. I have tried the following code with the given telerik discussion https://www.telerik.com/forums/no-check-uncheck-all-event 

But the div is still visible. Is there any way to hide the div ? Please correct me if i understood it wrong . Thanks. !

function OnClientItemChecked(sender, args) {
            var check = true;
            var uncheck = true;
            var checkedItems = sender.get_checkedItems().length;
            var c = sender.get_items().get_count();
            for (var i = 0; i < sender.get_items().get_count(); i++) {
                if (!sender.get_items()._array[i].get_checked()) {
                    check = false;
                }
                if (sender.get_items()._array[i].get_checked()) {
                    uncheck = false;
                }
            }
            if (check) {
                        }
            if (uncheck) {
                    document.getElementById('<%=divGrids.ClientID%>').style.display = 'none';
            }
        }

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Oct 2018, 01:01 PM
Hello Sendhil,

There is an event that fires when the Check All checkbox is toggled: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/events/onclientcheckallchecked. You can also get the checked items both on the client, and on the server: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/functionality/checkbox-support and https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/objects/radcombobox-object.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ComboBox
Asked by
Sendhil
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or