gpt4 book ai didi

c# - objectlistview 如何更改组标题中的文本?

转载 作者:太空狗 更新时间:2023-10-29 21:33:03 25 4
gpt4 key购买 nike

我想更改组标题的名称,但我无法在文档或谷歌上找到任何解决方案。

标题中的文本应该是在组中汇总的时间。

它应该是这样的:

enter image description here

最佳答案

the text in the header should be a time which is summed up in the group.

没问题:)

olv.AboutToCreateGroups += delegate(object sender, CreateGroupsEventArgs args) {
foreach (OLVGroup olvGroup in args.Groups) {
int totalTime = 0;

foreach (OLVListItem item in olvGroup.Items) {
// change this block accordingly
MyRowObjectType rowObject = item.RowObject as MyRowObjectType;
totalTime += rowObject.MyNumericProperty;
// change this block accordingly
}

olvGroup.Header += String.Format(" (Total time = {0})", totalTime);
}
};

关于c# - objectlistview 如何更改组标题中的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32779907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com