TreeListColumn.SummaryFooter Property
Specifies the type of the summary to calculate against all nodes.
Namespace: DevExpress.XtraTreeList.Columns
Assembly: DevExpress.XtraTreeList.v18.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
SummaryItemType | **None** | A SummaryItemType enumerator value that specifies the summary type applied. |
Available values:
Name | Description |
---|---|
Sum | Calculates the sum of field values within a group of column cells. |
Min | Retrieves the minimum value within a group of column cells. |
Max | Retrieves the maximum value within a group of column cells. |
Count | Calculates the number of nodes within a group of column cells. |
Average | Calculates the average field value within a group of column cells. |
Custom | Allows a user to define a custom summary value by handling the TreeList.GetCustomSummaryValue event. |
None | Summary is not calculated. |
Remarks
The SummaryFooter property defines the type of summary to calculate against all nodes. This summary information is displayed in the Summary Footer at the bottom of the Tree List control in the corresponding column. To display the summary footer, enable the TreeListOptionsView.ShowSummaryFooter property.
The summary format is determined by the TreeListColumn.SummaryFooterStrFormat string.
If the TreeListColumn.AllNodesSummary property is set to false, the summary is calculated only against root nodes. If the AllNodesSummary is true, the summary is calculated against root nodes and all their children.
To calculate summary information against children of every node use the TreeListColumn.RowFooterSummary property.
Example
The following example demonstrates how to calculate the sum for the column bound to the “Size(Bytes)” field. The function type and summary value formatting are set via the TreeListColumn.SummaryFooter
and TreeListColumn.SummaryFooterStrFormat properties.
The TreeListColumn.AllNodesSummary property is set to true to calculate the summary across all nodes within the control. The TreeListOptionsView.ShowSummaryFooter option is enabled to display the summary footer.
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
// ...
treeList1.OptionsView.ShowSummaryFooter = true;
TreeListColumn column = treeList1.Columns["Size(Bytes)"];
column.AllNodesSummary = true;
column.SummaryFooterStrFormat = "Total Sum {0:n0}";
column.SummaryFooter = SummaryItemType.Sum;