views:

1342

answers:

2

Does anyone know of a ListView implementation that support UI Virtualization when grouping is enabled? By default the VirtualizingStackPanel is disabled when grouping is setup.

It seems that Microsoft is not going to implement this within v4.0 of the .NET Framework so I am look for alternate solutions.

A: 

One option is to take a look a Bea Stollniz's series on improving a TreeView's performance: Part 1, Part 2, and Part 3. While what she does is more geared to TreeViews, which don't have any virtualization because they group by default, the lessons learned could definitely be applied to a custom ListView that has virtualizing groups. In fact, in part 3, she uses a ListBox as her base to create the virtualizing tree, which is a good start for virtualized grouping as well. Obviously displaying the items like in a TreeView has some diffrences, such as selection of the group nodes, from a ListView with grouping, but that could be fixed by catching the SelectionChanged.

rmoore
Thanks! I had a look at the sample code in Part 3. The main difficulty I am having is how would I add the grouping item using the GroupDescriptions
Luke
+3  A: 

I have located a sample at Grouping and Virtualisation MSDN Code Sample that converts the grouped ListView into a flat list which supports virtualization. However I can't work out how to imitate the expanding actions of the headers.

Luke