Back to Devexpress

How to: Calculate a summary against groups of nodes

windowsforms-5615-controls-and-libraries-tree-list-examples-summaries-how-to-calculate-a-summary-against-groups-of-nodes.md

latest1.3 KB
Original Source

How to: Calculate a summary against groups of nodes

  • Nov 13, 2018

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}"