Back to Devexpress

Group Summaries

windowsforms-5613-controls-and-libraries-tree-list-feature-center-summaries-group-summaries.md

latest2.1 KB
Original Source

Group Summaries

  • Sep 03, 2021

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

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.

  2. Make group footers visible.

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:

csharp
treeList1.OptionsView.ShowRowFooterSummary = true;
treeList1.Columns["Budget"].RowFooterSummary = SummaryItemType.Sum;
treeList1.Columns["Budget"].RowFooterSummaryStrFormat = "Budget Total {0:c}";
vb
TreeList1.OptionsView.ShowRowFooterSummary = True
TreeList1.Columns("Budget").RowFooterSummary = SummaryItemType.Sum
TreeList1.Columns("Budget").RowFooterSummaryStrFormat = "Budget Total {0:c}"