1
codeBehindのListboxのDisplayMemberPathPropertyとSelectedValuepathPropertyを設定する方法は?WPFのリストボックスのSetBinding
Listbox1.SetBinding(ListBox.ItemsSourceProperty, new Binding { Source = _ItemCollection});
上記のコード行はうまくいき、リストボックスのデータを見ることができます。
しかし、displaymemberpathpropとselectedvaluememberpathpropを設定しようとすると動作しません。私はこの
Listbox1.SetBinding(ListBox.ItemsSourceProperty, new Binding { Source = _ItemCollection});
Listbox1.SetBinding(ListBox.DisplayMemberPathProperty, "FirstName") ;
Listbox1.SetBinding(ListBox.SelectedValuePathProperty, "Id");
のような何かをしたあなたは、このパスを動的にする場合を除き シャラス