WPF Master/Detail data binding between 2 combobox

后端 未结 3 1551
太阳男子
太阳男子 2021-01-28 05:48

I have two combobox where Parent has to show the list of Countries and the child combo has to show a list of cities of the choosen country. The data is stored in a Diction

3条回答
  •  青春惊慌失措
    2021-01-28 06:29

    If your dictionary CountriesCitiesList contains country Id as Key and List as cities name, you can bind it in pure xaml way something like this -

    
       
          
             
          
       
    
    
    

    I am assuming you want to show country Id's in cbCountriesList since you are binding it to the dictionary with key of int type.

提交回复
热议问题