4
Answers

Binding a combobox to a list of strings

Jean

Jean

15y
43.4k
1
Is there anyone who has a nice example of how to bind a combobox so that it contains items from a List of strings?

Thanks.

this is how my code looks:

List<string> _items = new List<string>();
public List<string> Item
{get { return _items; }
  set { _items = value; }
}

and this is the combobox:

<ComboBox ItemsSource="{Binding Item}" Name="comboBox1" Width="120" />
Answers (4)