I have a combobox that has a dictionary as a datasource. I am trying to lookup a key in the combobox and get the display value for it. FindString looks up the display value.
var dictionary = new Dictionary<string, string>();
dictionary.Add("key1", "value1");
dictionary.Add("key2", "value2");
dictionary.Add("key3", "value3");
comboBox1.DataSource = new BindingSource(dictionary, null);
comboBox1.ValueMember = "Key";
comboBox1.DisplayMember = "Value";
comboBox1.FindString("key3") //returns -1
comboBox1.FindString("value3") //returns 2
But I want to lookup key3's display value. How can I do that?