Simple binding to class list does not work

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 02 Apr 2008 Link to this post


    with radcombo the same problem as describe here with radlistbox:

    I use a forms.combobox and bind it to a List<MyClass>.
    Then I set DisplayMember to the name of a porperty.

    In the selectedindexchanged I do:
    MyClass selEle=combobox.SelectedValue as MyClass;

    And (as expected) I get an object assigned if there is a selected item in the CB.

    But always null with RADCombobox


  2. Nikolay
    Nikolay avatar
    1802 posts

    Posted 03 Apr 2008 Link to this post

    Hi Manfred Pohler,

    As I have replied in the forum post Listbox bound with List<Class> , RadControls for WinForms and the Microsoft controls are similar, but due to the additional range of functionality that RadControls offer, there are certain differences in the API and their behavior.

    If you want to get your own custom object, based on a selected item, you should assign the object to the Tag property of the RadComboBoxItem in the ItemDataBound event handher of RadComboBox. For additional information, please refer to our Help Documentation article: RadComboBox >> Databinding >> ItemDataBound event .

    I have attached a sample application to demonstrate the approach.

    I hope this helps. Please feel free to contact me with other questions you have.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top