I assume you have defined the three entities with navigational properties connecting Customers to CustomersOrders and CustomersOrders to Orders. If not use the entity model designer where you can right click your entities and add the relevant associations between the entities. Remember to check that you are generating navigational properties.
If the model context is set up like that it is straight forward to query your customer's orders. There are several ways to do that. One of them could be a LINQ expression:
using (var context = new MyEntityContext())
{
var query = from customerOrder
in context.CustomersOrders
where customerOrder.CustomerId.Equals(myCustomerId)
select customerOrder;
myGridView.ItemsSource = query.ToList();
}
Here I am assuming you have a customerId in myCustomerId. If you only have a name, not an Id you could do something like:
using (var context = new MyEntityContext())
{
var query = from customerOrder
in context.CustomersOrders.Include("Orders")
where customerOrder.Customer.Name.Equals(myCustomerName)
select customerOrder;
myGridView.ItemsSource = query.ToList();
}
In the above I assume that your navigational property from CustomersOrders to Customer is called "Customer". The "Include" makes sure the associated orders get loaded. If not included, the ToList call will assume you don't need the orders and you will not be able to refer to them in your GridView.
In your grid view you could make a binding to the OrderName using Path=Order.OrderName and a binding to Total with Path=Total. Here I am assuming your navigational property from CustomersOrders to Orders is called "Order".