I'm trying to create a master detail view of a linq to sql relationship in wpf. The view will have two comboboxes. One for selecting the master item and another for selecting the detail item.
I have achieved this using an ADO.Net Dataset containing two tables and a relationship between the tables. where the first combobox binds to the master field and the second combobox binds to the relationship.
DataContext="{Binding Source={StaticResource ContactDataSet}, Path=Company}"
Master
<ComboBox Name="comboBox_CompanyName"
ItemsSource="{Binding}"
DisplayMemberPath="Company"
IsSynchronizedWithCurrentItem="True"
/>
Detail, Company2Contact is the relationsip
<ComboBox Name="comboBox_ContactName"
ItemsSource="{Binding Path=Company2Contact}"
DisplayMemberPath="Contact"
IsSynchronizedWithCurrentItem="True"
/>
I am looking to achieve similar results using linq to SQL. If set the wpf datacontext to a the linqDataContext i can bind to the master data ok but cannot bind to the relationship.
I have looked at datacontext object and it seems to have been setup correctly. Each company object is present and contains a collection of Contact objects.
Does anyone know how to bind to the collection of contact objects stored in the selected company object?
Thanks