Back to Devexpress

PivotFieldDisplayTextEventArgs.Value Property

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

latest7.3 KB
Original Source

PivotFieldDisplayTextEventArgs.Value Property

Gets the processed item’s value.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public override object Value { get; }
vb
Public Overrides ReadOnly Property Value As Object

Property Value

TypeDescription
Object

An object which represents the item’s value.

|

Remarks

If the PivotGridControl.FieldValueDisplayText event is raised for a field value header or total header the Value property returns the value of the corresponding column field or row field. If this event is fired for a grand total header or data field header the Value property will return null. To determine the type of the currently processed header use the PivotFieldValueEventArgsBase<T>.ValueType property.

If the PivotGridControl.FieldValueDisplayText event is fired for an item within a filter dropdown, the Value property returns the field’s value that corresponds to this item.

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

csharp
IOLAPMember currentMember =
   e.Field.GetOLAPMembers().First(m => Object.Equals(m.Value, e.Value));
e.DisplayText +=

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

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

winforms-pivot-grid-hide-empty-columns-and-rows/CS/Form1.cs#L59

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

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

csharp
if (ReferenceEquals(e.Field, fieldCustomMonth)) {
    DateTime dt = Convert.ToDateTime(e.Value);
    if (dt == beforeDate)

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#L32

vb
If e.Field Is fieldProduct Then
    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)

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

winforms-pivot-grid-hide-empty-columns-and-rows/VB/Form1.vb#L68

vb
If ReferenceEquals(e.Field, pivotGridControl1.Fields(Month)) Then
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt(e.Value))
End If

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

vb
If ReferenceEquals(e.Field, fieldCustomMonth) Then
    Dim dt As Date = Convert.ToDateTime(e.Value)
    If dt = beforeDate Then

See Also

DisplayText

IsPopulatingFilterDropdown

PivotFieldDisplayTextEventArgs Class

PivotFieldDisplayTextEventArgs Members

DevExpress.XtraPivotGrid Namespace