views:

822

answers:

2

I have 2 classes i.e Customer-Order and Customer class has a reference to a collection of Orders. I use master detail bindingSources.

My problem is when i use the lazy load pattern for orders my detail bindingsource is not updated.

UI

BindingSource1.datasource=GetCustomers();
BindingSource2.DataMember="Orders";
BindingSource2.datasource=BindingsSource1;

So in my datagridView1 Click event

if (customer.orders!=null){ customer.Orders=LoadOrders();}

I appreciate any help with this

+1  A: 

Try reseting the binding:

BindingSource1.DataSource = GetCustomers();
BindingSource2.DataMember = "Orders";

BindingSource2.DataSource = BindingSource1;
BindingSource2.ResetBindings(true);
Julien Poulin