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

Check if all radcombobox items are checked on button click

1 Answer 403 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ahmad
Top achievements
Rank 1
ahmad asked on 28 Dec 2020, 03:52 PM

Dear all,

 

is there a way to check if all radcombobox items are check on a button click event?

 

thanks

1 Answer, 1 is accepted

Sort by
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:

function OnClientClicked(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:

protected void RadButton1_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/.

Tags
ComboBox
Asked by
ahmad
Top achievements
Rank 1
Answers by
Doncho
Telerik team
Share this question
or