Objectlistview, how to change the text in the group header?

I want to change the name of the group header, but I cannot find any solutions in the documentation or in google.

The text in the title should be the time that is summed in the group.

this is how it should look:

enter image description here

+5
source share
1 answer

The text in the title should be the time that is summed in the group.

No problems:)

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); } }; 
+5
source

Source: https://habr.com/ru/post/1232261/


All Articles