如何在DataGridView上使用实体数据源的导航属性?

时间:2012-02-21 00:38:10

标签: winforms entity-framework datagridview datasource

实体之间有以下关系。

客户 - >地址(通过导航属性)

我将客户绑定到网格,但如何使用导航属性显示地址信息?我一直在搜索,无法弄明白。 :(

这是我目前的代码。我还尝试将Grid中的DataProperty设置为" Address.Street",没有运气。

GroomerEntities context = new GroomerEntities();

context.ContextOptions.LazyLoadingEnabled = true;

gvCustomers.DataSource = context.Customers;

0 个答案:

没有答案