Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Ultragrid GroupRow Summary: setting the caption (Displayformat, ..?)

Ultragrid GroupRow Summary: setting the caption (Displayformat, ..?)

New Discussion
Martin Seip
Martin Seip asked on Sep 25, 2026 7:50 AM

Hi,

my Ultragrid (v23.2) is databound to a DataTable. I use the code below code to add two summaries, one is a “ordinary” row count and the other is a custom made distinct count for a specific column CustomerID. This works fine as long as the summaries are at the end of the grid. But as soon as I group by a column, the caption of the group row header is wrong. I experimented wird summary.Displayformat, band.GroupByRowDescriptionMask and others, but to no avail.

What I’d need is something like this, when e.g. grouping column is “city”:
City Hamburg: 45 rows, 8 DistinctCustomers

What I get is:
City: Hamburg: CustomerID CustomerIDs: 45, distinct CustomerIDs: 8

As you see, the name of the aggregated column ist redundant. How can I remove it form the group row caption?

See attachment for graphics :).

My Code:

var bndAP = ugr.DisplayLayout.Bands[0];
bndAP.Override.GroupByRowDescriptionMask = "[caption]: [value]";
if (!bndAP.Summaries.Exists("CountRows"))
{
    var summary = bndAP.Summaries.Add(
        "CountRows",
        SummaryType.Count,
        bndAP.Columns["CustomerID"]);
    summary.DisplayFormat = "CustomerIDs: {0}";
    summary.Appearance.FontData.Bold = DefaultableBoolean.True;
    summary.SummaryPosition = SummaryPosition.Left;
    summary.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRows | SummaryDisplayAreas.BottomFixed;
}

if (!bndAP.Summaries.Exists("DCountCustomerIDs"))
{
    var summary = bndAP.Summaries.Add(
        "DCountCustomerIDs",
        SummaryType.Custom,
        new DistinctCountSummaryCalculator(),
        bndAP.Columns["CustomerID"],
        SummaryPosition.Left, 
        null
    );
    summary.DisplayFormat = "distinct CustomerIDs: {0}";
    summary.Appearance.FontData.Bold = DefaultableBoolean.True;
    summary.SummaryPosition = SummaryPosition.Left;
    summary.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRows | SummaryDisplayAreas.BottomFixed;
}

 

Sign In to post a reply

Replies

  • 0
    Martin Seip
    Martin Seip answered on Sep 25, 2026 7:53 AM

    pic was missing.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Martin Seip
Favorites
0
Replies
1
Created On
Sep 25, 2026
Last Post
1 month, 2 weeks ago

Suggested Discussions

Tags

Created by

Created on

Sep 25, 2026 7:50 AM

Last activity on

Sep 25, 2026 7:50 AM