I'm loading a ListBox this way, which works and shows the selected items:
lstCollectionsType.SelectedValuePath = "ClientCollectionTypeID";
lstCollectionsType.DisplayMemberPath = "ClientCollectionType1";
lstCollectionsType.ItemsSource = MyClient.ClientCollectionTypes;
foreach (ClientCollectionType item in MyClient.ClientCollectionTypes)
And when trying to save the data, I do it as shown below. But it's not getting the current selected data. It's showing the data of how it was loaded. Make sense? It's not changing what is selected.
foreach (ClientCollectionType i in lstCollectionsType.Items)
if (i != null)
ClientCollectionType boo = MyClient.ClientCollectionTypes.SingleOrDefault(c => c.ClientCollectionTypeID == i.ClientCollectionTypeID);
boo.Selected = true;
boo.Selected = false;
Please help! Thank you so much for your time!
View Complete Post