Back to Devexpress

PivotFieldDisplayTextEventArgs.DisplayText Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotfielddisplaytexteventargs.md

latest6.0 KB
Original Source

PivotFieldDisplayTextEventArgs.DisplayText Property

Gets or sets the item’s display text.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public string DisplayText { get; set; }
vb
Public Property DisplayText As String

Property Value

TypeDescription
String

A string value that specifies the item’s display text.

|

Remarks

Initially the DisplayText property contains the text currently displayed by the item (in a field header or by an item in the filter dropdown). To provide custom text, assign it to this property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DisplayText 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.

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/CS/PivotGridCustomSummaryExample/Form1.cs#L109

csharp
if (e.IsColumn)
        e.DisplayText = "All Savings";
}

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/CS/WindowsApplication21/Form1.cs#L53

csharp
if (dt == beforeDate)
    e.DisplayText = beforeValue;

winforms-pivot-grid-hide-specific-columns-and-rows/CS/Form1.cs#L45

csharp
if (e.Field == pivot.Fields[PivotHelper.Month]) {
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName((int)e.Value);
}

winforms-pivot-grid-sort-data-by-olap-member-properties/CS/WinFormsPivotGridCustomOLAPSort/Form1.cs#L40

csharp
e.Field.GetOLAPMembers().First(m => Object.Equals(m.Value, e.Value));
e.DisplayText +=
   string.Format(" ({0:C2})", currentMember.AutoPopulatedProperties["List Price"].Value);

winforms-pivot-split-field-value-cells/CS/Form1.cs#L51

csharp
{
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName((int)e.Value);
}

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/VB/PivotGridCustomSummaryExample/Form1.vb#L84

vb
If e.IsColumn Then
    e.DisplayText = "All Savings"
End If

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/VB/WindowsApplication21/Form1.vb#L61

vb
If dt = beforeDate Then
    e.DisplayText = beforeValue
ElseIf dt = afterDate Then

winforms-pivot-grid-hide-specific-columns-and-rows/VB/Form1.vb#L52

vb
If e.Field Is pivot.Fields(PivotHelper.Month) Then
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt((e.Value)))
End If

winforms-pivot-grid-sort-data-by-olap-member-properties/VB/WinFormsPivotGridCustomOLAPSort/Form1.vb#L33

vb
Dim currentMember As IOLAPMember = e.Field.GetOLAPMembers().First(Function(m) Equals(m.Value, e.Value))
    e.DisplayText += String.Format(" ({0:C2})", currentMember.AutoPopulatedProperties("List Price").Value)
End If

winforms-pivot-split-field-value-cells/VB/Form1.vb#L52

vb
If e.Field Is pivot.Fields(PivotHelper.Month) Then
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt((e.Value)))
End If

See Also

Value

PivotFieldDisplayTextEventArgs Class

PivotFieldDisplayTextEventArgs Members

DevExpress.XtraPivotGrid Namespace