I want to use combo box and the following code is working but now I want to add to the combo box header default value ,i.e. there is value and like Item and when you open it you have the option to change it,how I can do that?
<ComboBox ItemsSource="{Binding Items}" SelectedValue="{Binding SelectedItem}"
Name="comboBox1" Text="Item" Grid.Column="3" Grid.Row="2" />
the code
private List<String> _items;
private String _selectedItem;
private String _selectedBusinessItem;
public List<String> Items
{
get { return _items; }
set
{
_items = value;
OnPropertyChanged("Items");
}
}
public String SelectedItem1
{
get { return _selectedItem; }
set
{
_selectedItem = value;
OnPropertyChanged("Items");
}
}
private void InitCombo()
{
Items = new List<string> { "item", "Item2", "Item3" };
SelectedItem1 = Items[0];
}