Get checked items for all RadComboBox ID's

4 posts, 1 answers
  1. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 07 Jul Link to this post

    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

     

  2. Greg
    Greg avatar
    4 posts
    Member since:
    Feb 2015

    Posted 08 Jul in reply to Ciupaz Link to this post

    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.

  3. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 10 Jul Link to this post

    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
  4. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    857 posts

    Posted 14 Jul Link to this post

    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

Back to Top