tags:

views:

8

answers:

1
+1  A: 

The error message alone gives it away - your binding has the wrong context.

You're setting the DataContext of your window to customerVm.Customers in the loaded method. That means that your bindings "start" from the Customers property already, and so the binding on your grid is actually trying to find customerVm.Customers.Customers. That's why you get the error message you do: an ObservableCollection has no Customers property.

You can either change it so the DataContext set in code is simply customerVm, or use ItemsSource={Binding} on the DataGrid (which will then just pick up the current DataContext).

Dan Puzey
The error message did give it away but could not see what I was doing wrong.Thanks that fixed!!!!