I am trying to create and add some ComboBoxItems to a ComboBox.
|
The problem is that the ComboBox displays a lot more info than I'd like to:

How can I make it display only the 'Personal Computer' part?
I know there are other ways to add items to a ComboBox but I need every ComboBoxItem to store two values: a string value to show in the ComboBox and an int value which I store using the Tag property. I need this int value for further use so unfortunately ignoring it is not an option.
So... is there any way to properly display the ComboBox items?
Daniel VlasceanuPosted Dec 10, 2010, 7:22 AM
I finally managed to get what I wanted.
CrishPosted Dec 10, 2010, 5:37 AM
you can refer this code to add item in combobox.
comboBox1.Items.Add(new Item("Blue", 1));
comboBox1.Items.Add(new Item("Red", 2));
comboBox1.Items.Add(new Item("Nobugz", 666));
Daniel VlasceanuPosted Dec 9, 2010, 1:15 PM
This is ridiculous. There are explicit ways to 'manually' create, customize and add ComboBoxItem objects to ComboBoxes but you can't use them? It works just fine in WPF/C# projects... What am I missing?
Subhendu DePosted Dec 9, 2010, 11:21 AM