Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Update Combobox ItemsSource

$
0
0

I have two combo boxes: cboContinents and cboCountries.

In cboContinents_ValueChanged event, I have: 

selectedContinent = cboContinents.Text.ToString();

List<string>lstCountries = MyClass.GetListOfCountries(selectedContinent);

cboCountries.ItemsSource = lstCountries;

The above logic seems to be working okay as the drop-down list associated with cboCountries is updated. HOWEVER, when an item in cboCountries is selected and I select another control, the text in cboCountries is automatically replaced by another item. It's like the index of the item is not matched with the value..

Pls help.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>