aspnet-devexpress-dot-web-dot-aspxsummaryitembase-9a7d4a4d.md
Gets or sets the pattern specifying the display format for the summary item.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue("")]
public virtual string DisplayFormat { get; set; }
<DefaultValue("")>
Public Overridable Property DisplayFormat As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
A String value that specifies the format pattern.
|
Use the DisplayFormat property to format the summary display text.
The summary pattern can include static text plus predefined indexed placeholders.
The {0} format item is the placeholder for the calculated summary value.
<dx:ASPxSummaryItem FieldName="amount" ShowInGroupFooterColumn ="amount" SummaryType="Sum" DisplayFormat="My Caption: {0}"/>
In the following example, if the “Price” column’s summary value is 100 , its formatted equivalent will be ‘Total of Price: $100.00’.
<dx:ASPxSummaryItem FieldName="amount" ShowInGroupFooterColumn ="amount" SummaryType="Sum" DisplayFormat="Total of {1}: {0:c2}"/>
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.
asp-net-web-forms-grid-create-report-based-on-grid-layout/CS/WebApplication1/ReportHelper.cs#L72
label.Summary = new XRSummary() { Running = SummaryRunning.Group };
label.Summary.FormatString = item.DisplayFormat;
label.Summary.Func = GetSummaryFunc(item.SummaryType);
asp-net-mvc-grid-create-report-based-on-grid-layout/CS/E4755/Models/MVCxGridViewState.cs#L91
ShowInColumn = item.ShowInColumn;
DisplayFormat = item.DisplayFormat;
SummaryType = item.SummaryType;
asp-net-web-forms-grid-create-report-based-on-grid-layout/VB/WebApplication1/ReportHelper.vb#L74
label.Summary = New XRSummary() With {.Running = SummaryRunning.Group}
label.Summary.FormatString = item.DisplayFormat
label.Summary.Func = GetSummaryFunc(item.SummaryType)
asp-net-mvc-grid-create-report-based-on-grid-layout/VB/E4755/Models/MVCxGridViewState.vb#L185
ShowInColumn = item.ShowInColumn
DisplayFormat = item.DisplayFormat
SummaryType = item.SummaryType
See Also
Online Demo: Card View - Total Summary
Online Demo: Grid - Grid Totals