Binding objects to comboBoxes

Thread is closed for posting
2 posts, 0 answers
  1. Miguel
    Miguel  avatar
    1 posts
    Member since:
    Jul 2008

    Posted 30 Jun 2009 Link to this post

    I'n testing OpenAccess to be used in our next application version.
    The proble we found is we can't assign object references to RadComboBox.
    We can load the combo box, and get the selected text value or integer value, but we cant get the selected object to be assigned to another object attribute.

    class Project
    public Country country;


    class Country
        public String code;
        public String name;

    The country class has an attribute of class Country and the web page has a list of contries in a RadComboBox.
    Then ComboBox items are loaded correctly, but when we need to store the project in the database, assigning the selected contry to the project.Contry attribute, we must query the database to the object reference using the text value of the selected combobox item.

    Is there any way we can get the selected object reference directly from the RadComboBox with out a query?


  2. Alexander
    Alexander avatar
    727 posts

    Posted 01 Jul 2009 Link to this post

    Hello Miguel ,

    I am afraid this is not possible as the ComboBox does not keep the whole objects. But using a query to retrieve the object should not bother you. The object should be already in memory and it will not be fetched again from the database if you request it from the same object scope which you use for getting the binding collection. The scope will search for it in memory and if it does not find it there, it will request it from the database. Hope that helps.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top