Back to Devexpress

PivotFieldEventArgs.Field Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotfieldeventargs.md

latest4.5 KB
Original Source

PivotFieldEventArgs.Field Property

Gets the field being processed.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public PivotGridField Field { get; }
vb
Public ReadOnly Property Field As PivotGridField

Property Value

TypeDescription
PivotGridField

A PivotGridField object which represents the field currently being processed.

|

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

wpf-pivot-grid-hide-specific-columns-and-row/CS/WpfApp/MainWindow.xaml.cs#L39

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

wpf-pivot-grid-change-summary-display-type/CS/HeaderMenuCustomizationExample/HeaderMenuHelper.cs#L57

csharp
PivotGridControl pivot = (PivotGridControl)sender;
PivotGridField field = e.GetFieldInfo().Field;
if (Convert.ToBoolean(field.GetValue(HeaderMenuHelper.AllowFieldSummaryTypeChangingProperty)))

wpf-pivot-grid-split-field-value-cells/CS/Window1.xaml.cs#L46

csharp
void pivotGrid_FieldValueDisplayText(object sender, PivotFieldDisplayTextEventArgs e) {
    if(e.Field == pivotGrid.Fields[PivotHelper.Month]) {
        e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName((int)e.Value);

wpf-pivot-grid-hide-specific-columns-and-row/VB/WpfApp/MainWindow.xaml.vb#L49

vb
Dim pivot As PivotGridControl = CType(sender, PivotGridControl)
If e.Field Is pivot.Fields(PivotHelper.Month) Then
    e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt(Fix(e.Value)))

wpf-pivot-grid-change-summary-display-type/VB/HeaderMenuCustomizationExample/HeaderMenuHelper.vb#L52

vb
Dim pivot As PivotGridControl = CType(sender, PivotGridControl)
Dim field As PivotGridField = e.GetFieldInfo().Field
If Convert.ToBoolean(field.GetValue(HeaderMenuHelper.AllowFieldSummaryTypeChangingProperty)) Then

wpf-pivot-grid-split-field-value-cells/VB/Window1.xaml.vb#L44

vb
Private Sub pivotGrid_FieldValueDisplayText(ByVal sender As Object, ByVal e As PivotFieldDisplayTextEventArgs)
    If e.Field Is Me.pivotGrid.Fields(Month) Then
        e.DisplayText = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(CInt(e.Value))

See Also

PivotFieldEventArgs Class

PivotFieldEventArgs Members

DevExpress.Xpf.PivotGrid Namespace