Winforms 如何在DataGridView上使用实体数据源的导航属性?
我在实体之间有以下关系 客户->地址(通过导航属性) 我正在将客户绑定到网格,但是如何使用导航属性显示地址信息?我找遍了,找不出来( 这是我当前的代码。我还尝试将网格中的DataProperty设置为“Address.Street”,但没有成功Winforms 如何在DataGridView上使用实体数据源的导航属性?,winforms,entity-framework,datagridview,datasource,Winforms,Entity Framework,Datagridview,Datasource,我在实体之间有以下关系 客户->地址(通过导航属性) 我正在将客户绑定到网格,但是如何使用导航属性显示地址信息?我找遍了,找不出来( 这是我当前的代码。我还尝试将网格中的DataProperty设置为“Address.Street”,但没有成功 GroomerEntities context = new GroomerEntities(); context.ContextOptions.LazyLoadingEnabled = true; gvCustomers.DataSource = c
GroomerEntities context = new GroomerEntities();
context.ContextOptions.LazyLoadingEnabled = true;
gvCustomers.DataSource = context.Customers;