/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
choices["A"] = "Arthur"; choices["F"] = "Ford"; choices["T"] = "Trillian"; choices["Z"] = "Zaphod"; comboBox1.DisplayMember = "Value"; comboBox1.ValueMember = "Key"; //Now you can set comboBox1.SelectedValue = "F" and it will display "Ford"! How cool is that?
URL: http://madprops.org/blog/Bind-a-ComboBox-to-a-generic-Dictionary/