Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Winforms 如何在DataGridView上使用实体数据源的导航属性?_Winforms_Entity Framework_Datagridview_Datasource - Fatal编程技术网

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

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

我在实体之间有以下关系

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

我正在将客户绑定到网格,但是如何使用导航属性显示地址信息?我找遍了,找不出来(

这是我当前的代码。我还尝试将网格中的DataProperty设置为“Address.Street”,但没有成功

GroomerEntities context = new GroomerEntities();

context.ContextOptions.LazyLoadingEnabled = true;

gvCustomers.DataSource = context.Customers;