Display certain variable of each object into a Combobox
问题 Quick question.. I have a List of objects of this class: public class Whatever { public string Name { get; set; } public List<blaBla> m_blaBla { get; set; } // .. } And I want to link the List<Whatever> to a ComboxBox, where the user sees the Name of each Whatever object. How can I do that? 回答1: You could either use ComboBox.ItemTemplate like this: C#: List<Whatever> lst = new List<Whatever>(); public MainWindow() { InitializeComponent(); cmb.ItemsSource = lst; } XAML: <ComboBox Name="cmb">