okay so this one was fun - gotta love the simple act of getting your terminology right in order to pose the correct questions. The solution here is that I was looking for a WPF Lookup Combobox - absolutely everything is explained here:
http://msdn.microsoft.com/en-us/vbasic/cc788742.aspx
compliments of my hero, Beth Massi.
the code is attached for my solution in particular.....
here is at the class level:
Code:Private customerdata As New CustomerDataSet Private customer_type_data As New Customer_TypeDataSet Private tacust As New CustomerDataSetTableAdapters.CustomerTableAdapter Private tamanager As New CustomerDataSetTableAdapters.TableAdapterManager Private Customer_Type_Lookup As New Customer_TypeDataSet.Customer_TypeDataTable
and at the window loaded level:
and finally the correct xaml:Code:Dim tacustomer_type_lookup As New Customer_TypeDataSetTableAdapters.Customer_TypeTableAdapter tacustomer_type_lookup.Fill(Me.Customer_Type_Lookup) Me.tacust.Fill(Me.customerdata.Customer) Me.tamanager.CustomerTableAdapter = tacust Me.DataContext = Me.customerdata.Customer Me.cbCustomerType.ItemsSource = Me.Customer_Type_Lookup
to my knowledge, the above code will reproduce the exact same thing as a winforms developer setting the datasource of a combobox to one table, then setting the databinding Text property to another. Also, keep in mind that in both my customer table and my customer_type table, the field name was the same, so in your case, if they are different, the xaml would need to reflect the displaymemberpath and the SelectedValuePath as the field name in the lookup table (the winforms datasource) and the SelectedValue would need to be the field name in the Table you are browsing (the winforms databindings text property)Code:<ComboBox Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="361,70,0,0" Name="cbCustomerType" VerticalAlignment="Top" Width="300" IsEnabled="False" IsReadOnly="True" DisplayMemberPath ="Customer_Type" SelectedValue="{Binding Path=Customer_Type}" SelectedValuePath="Customer_Type"/>
enjoy :-)
Thanks to Beth Massi and her contributions to us VB newbies




Reply With Quote