Multi column combo data binding

Thread is closed for posting
6 posts, 1 answers
  1. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 16 Feb 2010 Link to this post

    Hi... I am using the Q3 2009 version of your controls and I am trying to understand your data binding.  What I would like to do is to bind the combo to a single field in one table but display a list based on another.   I am just migrating to the telerik controls and .Net and in other ActivieX controls (non telerik) they had two properties that allows me to accomplish this.  They combo boxes had a RowSource and a DataSource.  The model was simple for me to understand.  I would bind the control to the data source but, use the row source for the list.  For the Telerik control I have noticed that it only has the Data source property.  And Until that is set , I cannot set the Value Member or the Display Member properites.
    Please can you help me to accomplish this?  Where am I going wrong or not underdstanding

    Thank you.
  2. Answer
    Victor avatar
    1358 posts

    Posted 17 Feb 2010 Link to this post

    Hello Carol Watson,

    Thank you for writing. From what you wrote I understand that you need to populate one combo box with some data but display different data. I am afraid that the data binding mechanism in windows forms does not work this way. Please have a look at the MSDN articles related to data binding. You should also do some research on the System.Data namespace as it provides the primary means of storing data, namely the DataSet, DataTable, DataView (the data view allows filtering) and the TableAdapter classes. The data binding of our controls is not special and it works just as the way it works in the standard Microsoft Windows Forms controls.

    Kind regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 18 Feb 2010 Link to this post

    Sorry... I should have perhaps provided an example.  Imagine if you will two tables, One, contains customer orders and and another customers.  The customer orders table contains a Customer ID field as does the customer table. 

    I have a form that displays all the customer orders ... all the controls on that form are bound to that table.  I would like to bind the combo box specifically to the customerID on the customerOrders table so it updates that table.  I would however like the list in the dropdown to display the list of customers available in the customers table, displaying the Customer Name but storing the CustomerID. 

    My older ActiveX controls seperated the two by having a datasource and a rowsource property.   For me, that was simple to understand.  I have noticed with your .NET controls (I am not sure that this is something common to .NET) doesn't seperate the two and as such I have been struggling to 'figure out' how to accomplish the same task using your Multicolumn combo box.
  4. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 19 Feb 2010 Link to this post

    Please disregard last post.  Your reply was the answer.  Thank you very much for the assist.
  5. Tajes
    Tajes avatar
    81 posts
    Member since:
    Sep 2009

    Posted 17 Nov 2010 Link to this post

        I'm trying to do exactly the same, but I use OpenAccess ORM to provide data. I have a BindingSource to binding the form's controls and I set  the BindingSource.DataSource to myContext.MyPersistentClass.getall<MyPersistentClass>(). I'm also trying to change a field of this class, getting it from another Persistent class (another "table"). These two classes/tables have a relationship provide by OpenAccess and implemented by a foreing key constraint in the database.
         I looked up in the links above, but I don't use DataSet, nor DataTable, nor TableAdapter. What can I do?

  6. Svett
    Svett avatar
    728 posts

    Posted 22 Nov 2010 Link to this post

    Hello Iván Tajes,

    As my colleague mentioned, the data binding mechanism in windows forms does not support populating one combo box with some data but display different data. Please have a look at the MSDN articles related to data binding. If you want to sort the data you can simply use the sort mechanism provided by OpenAccess. You can read more about this in this documentation article. Another approach is to set the Sorted property of RadComboBox control:

    combo.Sorted = Telerik.WinControls.Enumerations.SortStyle.Ascending;

    Should you have any further questions, I will be glad to help.

    Best wishes,
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.
Back to Top