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

Get checked items for all RadComboBox ID's

3 Answers 2163 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ciupaz
Top achievements
Rank 2
Veteran
Ciupaz asked on 07 Jul 2020, 03:33 PM

Hello,
in my ASP.NET WebForms page I have several RadComboBox like this:

<telerik:RadComboBox ID="radComboBoxFormat"
                EmptyMessage="Format"
                MarkFirstMatch="true" Width="100%" runat="server" CheckBoxes="true"
                DataTextField="Description"
                DataValueField="Code">
</telerik:RadComboBox>

 

Now I'd like to write a method that iterates through selected items 
and compose a List<string>, or a comme separated value long string, 
of the item's selected code, but one only method valid for all 
RadComboBox of the page (for not having duplicated code). 

How can I achieve this?

Thanks a lot in advance. 

Luigi

 

3 Answers, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
answered on 08 Jul 2020, 04:17 PM

Are you looking for a client-side or server-side method?

For client-side, you can get all the RadComboBoxes via JQuery with $("div.RadComboBox"), getting the client-side telerik objects, and then iterating all the options.

For server-side, you can get all the RadComboBoxes via Reflection, and then grabbing the items.

0
Ciupaz
Top achievements
Rank 2
Veteran
answered on 10 Jul 2020, 07:18 PM
Only via server-side Greg, because I need to populate another RadComboBox 
based on selected items in the first RadComboBox. 

Do you have an example how can get this list server-side?

Luis
0
Accepted
Peter Milchev
Telerik team
answered on 14 Jul 2020, 02:02 PM

Hello Luis,

The checked items can be iterated with a simple loop and you can manually add the properties you need in a custom collection:

Regards,
Peter Milchev
Progress Telerik

Tags
ComboBox
Asked by
Ciupaz
Top achievements
Rank 2
Veteran
Answers by
Greg
Top achievements
Rank 1
Ciupaz
Top achievements
Rank 2
Veteran
Peter Milchev
Telerik team
Share this question
or