var list = new List<Dictionary<string, string>>{
new Dictionary<string,string>{
{"id","1"},
{"name","foo"},
},
new Dictionary<string,string>{
{"id","2"},
{"name","bar"},
}
};
I want to bind this list to a listbox. It's quite simple:
listBox.ItemsSource=list;
but the problem is: I can't control what is displayed in the listbox. What I want is to display is dict["name"]. I tried:
listbox.DisplayMemberPath="name"
Sadly it doesn't work.