Wie Festlegen von DisplayMemberPathProperty und SelectedValuepathProperty für Listbox in CodeBehind?SetBinding für Listbox in WPF
Die obige Codezeile funktioniert gut und ich kann die Daten in der Listbox sehen.
Aber wenn ich versuche, die displaymemberpathprop und selectedvalembermemberpathprop funktioniert nicht funktioniert. Ich habe so etwas wie diese
Listbox1.SetBinding(ListBox.ItemsSourceProperty, new Binding { Source = _ItemCollection});
Listbox1.SetBinding(ListBox.DisplayMemberPathProperty, "FirstName") ;
Listbox1.SetBinding(ListBox.SelectedValuePathProperty, "Id");
bitte
Dank Sharath