I would like to design a comboBox in C# WPF VS2013 on win 7 like
https://msdn.microsoft.com/en-us/library/windows/desktop/dn742404%28v=vs.85%29.aspx#guidelines
My xaml code:
<ComboBox Grid.Row="1" Grid.Column="1"
SelectedItem="{Binding MyObject}"
Margin="5" ItemsSource="{Binding MyObjList}"
DisplayMemberPath="Name"
/>
// MyObjList is a list of MyObject
public class MyObject
{
int id;
string Name;
}
Although I have initialized MyObjList in C# code behind it, the dropdown comboBox meue is blank.
I have search some related posts
How to show text in combobox when no item selected?
But, none of them work for me.
Could anybody point out where I made a mistake ?