Newest Update: Please read “GroupingCollection -> HierarchicalCollectionView” for a(nother/ better) solution to this problem.
Previous Update: Please read “Distinct Data Providers with GroupingCollection” for a solution.
Have you ever needed to display distinct items from an ArrayCollection based on a property of the objects in the collection? Here’s an example. An ArrayCollection populates a DataGrid with a list of people displaying the following properties: name, job and position. Beside the DataGrid you would like to display a distinct list of the jobs and positions from the data provider.
I am currently working on the DistinctArrayCollection which extends ArrayCollection. This new class will create and maintain these distinct data providers which are bindable to components.
Try it out:
This is a solution, but there is a better way to solve the problem.
Updates
Update: Please read “Distinct Data Providers with GroupingCollection” for a solution.
Newest Update: Please read “GroupingCollection -> HierarchicalCollectionView” for a(nother/ better) solution to this problem.
Scot,
This will work great. Please share once you have finished up extending the ArrayCollection class.
This is exactly what I’ve been looking for. I haven’t read the updated solution/posts yet but am really glad that you put this explanation together. I was banging my head against a flat dataset that needed 2 nested hierarchies based on properties.