|
Good evening all, Firstly thank you for the time taken to read this. I'm having some difficulty with a sorted & grouped listbox in WPF vb.net 3.5 that has an items source bound to an ObservableCollection. What I want to be able to do is to retrieve a piece of data from the ObservableCollection items source depending on what item in the listbox the user has selected. I've almost got it working but because the listbox is sorted it does not match the index of the items source. Here is the code that I have so far: VB.NET As I previously mentioned, because the lstBox is sorted and also grouped the index's don't match up. Does anyone know how I can get the correct information I want from the List Source depending on the selected item in the list box? Again, thank you very much for your time, Rob |
Wpf vb.net how to get a value from a listbox selected item
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Martin van Eerde22 reputationPosted Mar 14, 2011, 3:44 AM EDT
Not exactly sure what you are trying to do, but if not getting the selected item from the listbox is what you need you could try handling the CollectionChanged event on the ObservableCollection http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.collectionchanged(v=VS.90).aspx