Is there any way for a sub-grouping to know how many items are in the parent-grouping for a CollectionViewSource in .NET

StackOverflow https://stackoverflow.com/questions/12977095

Domanda

I have a Collection View source in which I've set two Group Descriptions

myCollectionViewSource.GroupDescriptions.Add(New PropertyGroupDescription("PrimaryProperty"))
myCollectionViewSource.GroupDescriptions.Add(New PropertyGroupDescription("SecondaryProperty"))

As Illustrated below, the primary grouping has found 338 records. Those are broken up into 179 pairs of records based on the secondary GroupDescription. If I'm evaluating a child grouping element, is there a way for me to get the ItemCount of the primary grouping from which it originally comes?

View of Groups

Please and thank you.

È stato utile?

Soluzione

based on your local values, you can simply use the following expression

((MS.Internal.Data.CollectionViewGroupInternal)myCollectionViewSource.View.Groups[0]).ItemCount
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top