WPF/C# - ´binding list<string> to combobox
c#, combobox, list, wpf, xaml
Solution
Remove the `SelectedValuePath` and `DisplayMemberPath` attributes. They are wrong.
Problem
I want my combobox item names and values to be taken from my List of course I don't want my view model to hold combobox items list. I got a list a,b,c,d ``` public List<String> ComboList { get; set; } ``` ... ``` ComboList = new List<String>(); ComboList.Add("A"); ComboList.Add("B"); ComboList.Add("C"); ComboList.Add("D"); ``` and my ComboBox `<ComboBox Margin="29,40,0,526" Width="212" Height="35" Grid.Row="1" ItemsSource="{Binding Path=ComboList, Mode=OneTime}" SelectedValuePath="Key" DisplayMemberPath="Value"></ComboBox>` but it gives me a empty ComboBox ...