is there a way to check if all radcombobox items are check on a button click event?
thanks
1 Answer, 1 is accepted
0
Doncho
Telerik team
answered on 31 Dec 2020, 08:56 AM
Hi Ahmad,
By using the API of the RadComboBox you can get its items collection and its selected items collection. You can compare their length or you also loop through the items in these collections:
On a client click event:
functionOnClientClicked(sender, args) {
var combo = $find('<%= RadComboBox1.ClientID %>');
var checkedItemsCount = combo.get_checkedItems().lentgh;
var allItemsCount = combo.get_items().get_count();
}
On a server button click event:
protectedvoidRadButton1_Click(object sender, EventArgs e)
{
var checkedItemsCount = RadComboBox1.CheckedItems.Count;
var allItemsCount = RadComboBox1.Items.Count;
}
You may find it useful to check out the following resources:
Please let me know if you have any further questions.
Kind regards,
Doncho
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.