Back to Devexpress

PivotCellDisplayTextEventArgs.DisplayText Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotcelldisplaytexteventargs.md

latest3.9 KB
Original Source

PivotCellDisplayTextEventArgs.DisplayText Property

Gets or sets the display text for the cell currently being processed.

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 that represents the cell’s display text.

|

Remarks

Initially the DisplayText property contains the text currently displayed in the cell. To provide custom text for the cell, assign it to this property.

The cell’s value can be obtained via the PivotCellEventArgsBase<TField, TData, TCustomTotal>.Value 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-pivot-grid-show-custom-display-text/CS/WinFormsPivotCustomCellDisplayText/Form1.cs#L19

csharp
if (Convert.ToSingle(e.Value) < 2000)
    e.DisplayText = "Low";
else if (Convert.ToSingle(e.Value) > 6000)

winforms-pivot-grid-differentiate-between-null-and-zero-values/CS/WindowsApplication53/Form1.cs#L46

csharp
if (Convert.ToDecimal(e.Value) == 0 && IsNullValue(e.CreateDrillDownDataSource(), e.DataField))
        e.DisplayText = "null";
}

winforms-pivot-grid-show-custom-display-text/VB/VBWinFormsPivotCustomCellDisplayText/Form1.vb#L22

vb
If Convert.ToSingle(e.Value) < 2000 Then
    e.DisplayText = "Low"
ElseIf Convert.ToSingle(e.Value) > 6000 Then

winforms-pivot-grid-differentiate-between-null-and-zero-values/VB/WindowsApplication53/Form1.vb#L39

vb
Private Sub pivotGridControl1_CustomCellDisplayText(ByVal sender As Object, ByVal e As DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs)
    If Convert.ToDecimal(e.Value) = 0 AndAlso IsNullValue(e.CreateDrillDownDataSource(), e.DataField) Then e.DisplayText = "null"
End Sub

See Also

PivotCellDisplayTextEventArgs Class

PivotCellDisplayTextEventArgs Members

DevExpress.XtraPivotGrid Namespace