Skip to main content

Group Summaries

Group summaries are calculated for each group of nodes that have the same parent. Below you’ll find information on setting up group summaries.

image

Group Summaries

There are two basic things that have to be done to calculate a group summary, and display its result within group footers.

  1. Specify the type of summary to calculate for a column.

    Set the column’s TreeListColumn.RowFooterSummary property to the desired type of aggregate function (a value other than SummaryItemType.None).

  2. Make group footers visible.

    Group summary values are displayed in group footers. So, set the Tree List’s TreeListOptionsView.ShowRowFooterSummary property to true to display group footers.

In addition, you can specify the format for group summary values via the TreeListColumn.RowFooterSummaryStrFormat property. See Formatting Summary Values to learn more.

Example

The following example demonstrates how to apply a group summary to the Tree List control. The TreeListColumn.RowFooterSummary and TreeListColumn.RowFooterSummaryStrFormat properties are used to set the function type and apply formatting to summary values. The TreeListOptionsView.ShowRowFooterSummary option is enabled to display row footers.

The following image shows the result:

TreeListColumn.RowFooterSummary

treeList1.OptionsView.ShowRowFooterSummary = true;
treeList1.Columns["Budget"].RowFooterSummary = SummaryItemType.Sum;
treeList1.Columns["Budget"].RowFooterSummaryStrFormat = "Budget Total {0:c}";