Suppose I have one ComboBox component and 2 TextBox in my GUI. And I have one DataView with data (City, PostalCode, Street, ID). By initializing all this, I populate the DataView with some data :)
City 1, 11111, Street 1, 1
City 1, 22222, Street 2, 2
City 1, 33333, Street 3, 3
Now I want to bind this to my ComboBox. The DataView is a member of the class named m_dvAdresses, but this code does not help:
ItemsSource="{Binding Source=m_dvAdresses}"
SelectedValuePath="ID"
DisplayMemberPath="Street">
I also want my 2 ComboBox objects to display PostalCode and City, depending on what I select in my ComboBox. For example, if I select "Street 2", TextBox1 will show me "City 1" and TexBox2 will show me "22222" ...
How can I bind them all ONLY in WPF code?
source
share