更改 datagrid wpf 中每个组的标题
我有一个数据网格,其中根据作者对行进行分组。
我已将数据网格与 Author 类对象的集合绑定在一起, 其中 Author 类具有三个属性,即 Book、Publication 和 Number ofpies,它们对应于数据网格中组中的列。
我的问题是我想显示每个作者该组的“副本数”总和。我没有得到的是我应该如何计算总和,因为它是针对一个组而不是针对每个对象或总数据网格。
能做到吗?
I have a datagrid in which I have grouped the rows according to the author.
I have bound the datagrid with collection of Author class objects,
where Author class have three properties as Book, Publication and Number of copies which would correspond to the columns in the group in datagrid.
My problem is I want to display the sum of 'Number of copies' for that group for each author. What I'm not getting is how shall I calculate the sum since it is for a group and not for each object or total datagrid.
Can it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
奇怪的是没有人回答这个问题,对于@Archie 来说可能为时已晚,或者更有可能他很久以前就找到了答案。但无论如何:
ItemCount 将为您提供每组中的项目数。
华泰
Strange that no one has answered this, and its probably too late for @Archie, or more likely he has found the answer long ago. But here goes anyway:
ItemCount will give you the number of items in each group.
HTH