Is it winforms, wpf or asp.net? [update: ahh ... winforms ;-p]
winforms wants the data to be IList(or, indirectly, through IListSource) - so I assume (from the comment) that you are using winforms. None of the built-in collections, like a dictionary, implements IList, but, frankly, it does not matter: if you are attached to the data, the volume is probably quite small, so the usual list should be in order.
- - List<T> BindingList<T>, T , . ? 1.1 ( HashTable, Dictionary<,>), ArrayList.
( #):
class MyData
{
public int Key { get; set; }
public string Text { get; set; }
}
[STAThread]
static void Main()
{
var data = new List<MyData>
{
new MyData { Key = 1, Text = "abc"},
new MyData { Key = 2, Text = "def"},
new MyData { Key = 3, Text = "ghi"},
};
ComboBox cbo = new ComboBox
{
DataSource = data,
DisplayMember = "Text",
ValueMember = "Key"
};
cbo.SelectedValueChanged += delegate {
Debug.WriteLine(cbo.SelectedValue);
};
Application.Run(new Form {Controls = {cbo}});
}