Seems its not the binding, its a inheritance/polymorphism problem.
Following situation:
- I've got a Collection , say "GarageList".
- In every garage there can be n "Cars" (1:n relationship).
- There are several sub types of "Car", say "BMW", "Toyota" and "Ford".
- In every garage there can only be one type of car.
First I want to select a garage out of a list (in this case a datagrid). -> works
After having selected a BMW garage, a list of BMWs is loaded. -> works
I show the details of the BMW in bound textboxes, checkboxes etc. -> works
I want to change the super type's details (Car's details) -> works
I want to change the BMW's details -> data is not transferred from control to entity
I can change the entity data of the "Car" super entity, but NOT the entity data special for the BMW. In this case, the control's data jumps back to the former value after leaving it, because the getter of the entity is called.
This is my code (simplyfied):
garageColl= new GarageCollection();
garageColl.GetMulti(null);
BindingSource bsGarages = new BindingSource();
bsGarages.DataSource = garageColl;
gridGarages.DataSource = bsGarages ;
BindingSource bsCars = new BindingSource();
bsCars.DataSource = bsGarages ;
bsCars.DataMember = "BMW"
TextBox1.DataBindings.Add(new Binding("Text", bsCars, "CarProp"));
TextBox2.DataBindings.Add(new Binding("Text", bsCars, "BmwProp"));
Textbox2 is readonly, Textbox1 is read- and writable.
The LLBLGen Designer created a 1:n relationship between garages and cars by its own, but i had to add custom relations (1:n) from garage to BMW to realize this scenario. Perhaps that's the problem?
Or did i miss something in the help document?
Thanks in advance again!