Skip to main content
A newer version of this page is available. .

TreeListColumn.SummaryFooterStrFormat Property

Gets or sets the format to display the TreeListColumn.SummaryFooter.

Namespace: DevExpress.XtraTreeList.Columns

Assembly: DevExpress.XtraTreeList.v18.2.dll

Declaration

[DefaultValue("{0}")]
[XtraSerializableProperty]
public string SummaryFooterStrFormat { get; set; }

Property Value

Type Default Description
String "{0}"

A string that specifies the format applied to the TreeListColumn.SummaryFooter.

Remarks

A format string may specify any characters but the “{“ and “}” characters have a special meaning. They are used for inserting summary values in the following combination: “{0}”. When the summary value is displayed this combination is substituted for the value itself.

If the TreeListColumn.SummaryFooter property is set to the SummaryItemType.Count value, you can use the following format string: “Total {0} records”. For instance, if there are 5 nodes, the summary will be displayed as follows: “Total 5 records”.

Generally, the format string is set in the following form:

<text>{0<:format character<precision specifier>>}<text>

Format specifiers are described in the Format Specifiers and Format Providers topic in MSDN.

If the SummaryFooterStrFormat property specifies an empty string, the summary value is displayed alone.

The Tree List pictured below demonstrates the summary calculated for the “Size(Bytes)” column. The SummaryFooterStrFormat property is set to the “Total Sum {0:n0}” string.

TreeListColumn.SummaryFooter

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;
See Also