I'm developing an application that use a combobox in wpf. I'm using a class that contain two values ID and Name, I'm bulding a list with this class to be the ItemsSource of the combobox, as follow:
Example.cs
foreach (XmlNode OEM in OEMs) { string OEMname = OEM.Attributes["OEMname"].InnerText; int ID = Int32.Parse(OEM.Attributes["ID"].InnerText); OEM oem = new OEM { OEMname = OEMname, ID = ID}; oems.Add(oem); } cbxSelOEM.ItemsSource = oems; My problem is the value shown in the combobox, instead of show the OEMname value they show other name, I believe that is the object name in the list. How can I solve this problem?
cbxSelOEM.DisplayName = "OEMname";