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

    Hi,

    with radcombo the same problem as describe here with radlistbox:
    http://www.telerik.com/community/forums/thread/b311D-bchmke.aspx

    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


    Regards

    Manfred
  2. Nikolay
    Admin
    Nikolay avatar
    1803 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.

    Regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top