CAUTION:When using the data source property it is not possible to add new items to the combo box with the following code:

cb.Items.Add(new ComboBoxItem("new item", 3);

Possible Solution2:If you do not want to create a class only for the combobox items you can also use the class "DictionaryEntry" in the namespace System.Collections. This gives you the ability to specify different datatypes for the display and value members as shown in the code below:

This code populates a combobox with different DictionaryEntry objects. The key can be any object and the value can also be any object. This adds the flexibility of using different display and value members in the same combobox. The last line is needed in order to get the selected value member through the according property of the combobox; because this is only "enabled" if a datasource is set. To retrieve the selected values you can use code like this:

If you have only display - value pairs which have all the same datatypes you could use the generic class KeyValuePair which is in the namespace System.Collections.Generic. With this you could populate your combobox like so:

The advantage of this is for sure the type safety; because you do not have to cast the key or the value to the correct datatype. The disadvantage of this is that they have all to be of the same key and value type because otherwise the cast when obtaining the selecteditem would throw an exception.Hope this may help someone :-)