WPF ComboBox text inside ListBox

Posted by geosteve on Stack Overflow See other posts from Stack Overflow or by geosteve
Published on 2010-04-16T22:15:33Z Indexed on 2010/04/16 22:23 UTC
Read the original article Hit count: 783

Filed under:
|
|
|

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")

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml