Back to Devexpress

GridSummaryItem.GetDisplayFormatByType(SummaryItemType, Boolean) Method

windowsforms-devexpress-dot-xtragrid-dot-gridsummaryitem-dot-getdisplayformatbytype-x28-devexpress-dot-data-dot-summaryitemtype-system-dot-boolean-x29.md

latest3.4 KB
Original Source

GridSummaryItem.GetDisplayFormatByType(SummaryItemType, Boolean) Method

Returns the default format string for the specified summary type.

Namespace : DevExpress.XtraGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public virtual string GetDisplayFormatByType(
    SummaryItemType itemType,
    bool fullForm
)
vb
Public Overridable Function GetDisplayFormatByType(
    itemType As SummaryItemType,
    fullForm As Boolean
) As String

Parameters

NameTypeDescription
itemTypeSummaryItemType

A SummaryItemType enumeration value representing the summary type.

| | fullForm | Boolean |

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

|

Returns

TypeDescription
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 valueThe 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

GetDisplayText(Object, Boolean)

GridSummaryItem Class

GridSummaryItem Members

DevExpress.XtraGrid Namespace