简体   繁体   中英

WPF datagrid grouping

I'm grouping my grid like this:

ListCollectionView collection = new ListCollectionView(_ActionCollection);
            collection.GroupDescriptions.Add(new PropertyGroupDescription("InvoiceNumber"));
            dataGrid1.ItemsSource = collection;

Now I want to get the sum of the items which are grouped.

For example:

If grouped ivnoice number 231 and 245 contain both 3 rows, how can I get the sum for the example id?

The base .NET DataGrid is just that - low level. Therefore, operations like this will require not only aggregate queries like the one metioned but also extensive UX effort.

Please refer to this post -- WPF data grid for financial style reporting? -- as it may be a better approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM