views:

165

answers:

0

I'm working on a project where I'm using DataBindings to update certain fields based on currently selected field. I have a series of textBoxes which are databound to a combo box, which at present is currently linked to a table as a data source. However there is a relationship between the ID of two tables, meaning the combobox should be linked to the first table, with it's ID, and the other table, with their ID's.

Let me try and explain as clearly as I can. Currently I have one table, TblOne, which stores information. One of the columns holds an ID field, which corresponds to a record in another table, TblTwo. So how can I make it so I can link the combobox to the ID field in TblOne, while still being able to databind other text boxes so they update to the relavent field in TblTwo.

In other words, the combobox is doing three jobs;

  1. Holding the current ID record for TblA/updating it's entry when the combobox selection is changed
  2. Listing all the selectable records in TblB
  3. Updating a series of text boxes that display the data in the records in TblB as pointed to by the corresponding ID in TblA

Language is C#/Linq