Skip to main content

GridSummaryItem.GetDisplayFormatByType(SummaryItemType, Boolean) Method

Returns the default format string for the specified summary type.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

public virtual string GetDisplayFormatByType(
    SummaryItemType itemType,
    bool fullForm
)

Parameters

Name Type Description
itemType SummaryItemType

A SummaryItemType enumeration value representing the summary type.

fullForm Boolean

true to add static text identifying summary type; otherwise, false.

Returns

Type Description
String

A string value representing the default format string used for the specified summary type.

Remarks

If the fullForm parameter is set to false, the GetDisplayFormatByType method simply returns the ‘{0}‘ string which specifies that the summary value should be displayed as is. Such formatting is used for footer summaries. Default formatting can, of course, be overridden using a summary item’s GridSummaryItem.DisplayFormat property.

For group summaries, the default summary value format is obtained passing true as the fullForm parameter. Format strings returned in this case are listed in the table below.

The itemType parameter value The method’s return value
SummaryItemType.Average (AVG={0})
SummaryItemType.Sum (SUM={0})
SummaryItemType.Count (Count={0})
SummaryItemType.Min (MIN={0})
SummaryItemType.Max (MAX={0})
SummaryItemType.Custom (Custom={0})

Note: when using the footer context menu, the applied summary is automatically formatted in a manner similar to formatting group summaries.

See Also