PDA

View Full Version : ComboBox bind with a ListBox



picapau
February 17th, 2009, 07:53 PM
Hi,
I've read the explendit Elgin Rogers' explanation about the use of combobox and this encourage me to post a new thread.

I'm using Visual C# 2008 Express Edition with SQL Server 2008 Express Edition.

I'm trying to link a combobox data with a listbox.

Let me explain. I've 3 tables:

1) Cars: with 2 fields: CarId, CarModel
2) Colors: with 2 fields: ColorId, ColorDescription
3) CarsColors: with 2 fields: CarId, ColorId

I just want to select a car from a ComboBox and display in a ListBox what colors it can be:

Per ex. car: Audi A4: colors: blue, green, black

It would be great if I can modify the color list by choosing a new color or deleting one.
Is there a way to do it with "bindingsources" and "tableadapters", or I have to do it in code?

Thanks a lot!