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

Combobox+CheckBox = selected items

1 Answer 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Yury
Top achievements
Rank 1
Yury asked on 07 Mar 2016, 11:20 PM

Hello dear friends.
There are combo box to "Checkbox" feature, how to get the name of the selected items?
With my 100 Russian rubles for beer)

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 09 Mar 2016, 08:53 AM
Hi Yury,

You can traverse this collection to achieve this requirement:
foreach (RadComboBoxItem item in RadComboBox1.CheckedItems)
{
    string text = item.Text;
}

If you are using ItemTemplate with checkboxes you can use the following approach:
Copy Code
protected void Button1_Click(object sender, EventArgs e)
{
    IEnumerable checkedItems = RadComboBox1.Items.Where(
        x => (x.FindControl("chk1") as CheckBox).Checked);
 
    foreach (RadComboBoxItem item in checkedItems)
    {
        string value = item.Value;
    }
}

I hope this will prove helpful.


Regards,
Eyup
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
ComboBox
Asked by
Yury
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or