List<Data> dataSource = new List<Data>();
List<Data> GetData()
{
dataSource.Add(new Data { Key = 1, Value = "US" });
dataSource.Add(new Data { Key = 2, Value = "China" });
return dataSource;
}
public void DataBind()
{
ComboBoxbaud.ItemsSource = GetData();
ComboBoxbaud.DisplayMemberPath = "Value";
ComboBoxbaud.SelectedValuePath = "Key";
ComboBoxbaud.SelectedValue = 1;
}
class Data
{
public int Key{ set; get; }
public string Value { set; get; }
}