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

GridSummaryItem.DisplayFormat Property

Gets or sets the summary value formatting.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v17.2.dll

Declaration

[DefaultValue("")]
[XtraSerializableProperty(100)]
public string DisplayFormat { get; set; }

Property Value

Type Default Description
String

String.Empty

A string specifying the summary value’s display format. An empty string to display the summary value using default formatting.

Remarks

The DisplayFormat property can be used to apply formatting to the summary value and add any static text to its textual representation. The general pattern for setting the DisplayFormat property value is the following:

<custom static text>{0<:format specifier<precision specifier>>}<custom static text>

Here, the ‘{0}‘ character sequence is the summary value’s placeholder. The format specifier sets the formatting type to be applied (currency, scientific, etc). The precision specifier sets the number of characters to be displayed after the decimal point.

For instance, if displaying currency values within a column, you can set the DisplayFormat property to ‘Total: {0:c2}‘. If the summary value is 123, the formatted summary value representation will be the ‘Total: $123.00‘.

Please refer to the Format Specifiers topic for details on using format specifiers.

Note: setting the DisplayFormat property to an empty string applies default summary value formatting. Please refer to the GridSummaryItem.GetDisplayFormatByType method description for details.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DisplayFormat property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also