title: Columns of two related database tables in one ASP.NET GridView with EntityDataSource
body: <p>I have two SQL Server tables with Primary Keys (PK) and a Foreign Key (FK) linking the two tables:</p>
  
  <pre><code>1) Table "Order"
  
  OrderID, int, PK  
  AddressID, int, FK
  ...
  
  2) Table "Address"
  
  AddressID, int, PK
  City, nvarchar(50)
  ...
  </code></pre>
  
  <p>Then I've created an (ADO.NET) Entity Data Model out of those two tables. 
  Now on my (ASP.NET) webpage I put a GridView with an EntityDataSource. In my GridView I want to display two columns: </p>
  
  <ul>
  <li>OrderID</li>
  <li>City (belonging to that order and linked by the AddressID-key)</li>
  </ul>
  
  <p>How can I do that? My problem is: When I configure the Entity Data Source I can select an "EntitySetName" which can be 
  either "Order" or "Address" but not both, nor can I select any kind of relationship. If I select "Order" as EntitySetName 
  then in the GridView I can add the columns </p>
  
  <ul>
  <li>OrderID  </li>
  <li>Address  </li>
  <li>Address.AddressID</li>
  </ul>
  
  <p>Adding the column "Address" displays empty cells. Adding "OrderID" and "Address.AddressID" displays the expected IDs. But how can I
  add the "City" of the related address to my GridView?</p>
  
  <p>Thank you for help in advance!</p>
  
  <p><b>Edit: Clarification:</b></p>
  
  <p>The Entity Framework has created a class "Order" and a class "Address" corresponding to the database tables. The class "Order" has a reference to an "Address" object as a navigation property, corresponding to the 1-n relationship between Address and Order table.</p>
  
  <p>Basically I want to have a column in my GridView which displays Order.Address.City. I have tried to add a bound field with "Address.City" as data field to the GridView but it results in a runtime error ("no such property...").</p>