WinForm Databinding - Children

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 20-Mar-2009 17:42:47   

I have a Customer entity on a form. It is bound to BindingSource1. The Customer has a field CountryFK, an int to a Country Entity.

A picker drop down is bound to a collection of possible countries in BindingSource2. It's edit value is bound to the customer.CountryFK via the BindingSource1.

The problem is that when I change the country picker to a new country, the Customer.Country is now null, though the Customer.CountryFK is correctly pointing to the new value.

The WinForm via the bindingsource2 is changing the customer.CountryFK in essence and I understand the LLBL context engine doesn't like you doing that.

Is there a way to have the customer.countryFK updated in this way. When I do this in a grid with a cell 'picker' it works fine.

Ian

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Mar-2009 19:12:37   

Is important to you to relate the related Country entity to Customer? What I can think is trapping the SelectIndexChanged event of the combo and in there assign the related Country object to the appropiate customer.

David Elizondo | LLBLGen Support Team