WPF ComboBox text inside ListBox
- by geosteve
I've got a list of ComboBoxes inside a listbox, like so:
<ListBox ItemsSource="{Binding Values}">
<ListBox.ItemTemplate>
<DataTemplate>
<ComboBox ItemsSource="{...}" IsTextSearchEnabled="True" IsEditable="True"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The Values for my listbox ItemsSouce is defined in my ViewModel as
public ObservableCollection<string> Values { get; set; }
How can I get the Text for each one of the ComboBoxes to show the Value for that particular ListBox item?
(i.e. if values is {"a", "b", "c"} I want a list of 3 comboboxes showing "a", "b" and "c")