0

I have a GridView bound to a BindingSource. My LINQ entity relationship is simple: Customer -> Orders.

So binding is simple, too: BindingSource source = new BindingSource(context, "Customers");

When I add a new row on the grid for the customer, the AddingNew event fires and it automatically inserts. However, when I expand the Customers node (its a hierarchical grid) and add a new order row, the AddingNew event doesn't fire on the binding source at all.

If I switch the binding source to: BindingSource source = new BindingSource(context, "Orders"); then I don't get my customers obviously, but inserting a new order works fine too.

Something tells me that it's not supporting the relationship properly or something. What am I missing?

4

1 回答 1

0

这通过定义网格的关系属性来工作。

于 2013-07-19T07:22:32.827 回答