Skip to main content
A newer version of this page is available. .

FieldValueElementData Class

Namespace: DevExpress.Xpf.PivotGrid

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

Declaration

public class FieldValueElementData :
    ScrollableAreaItemBase

The following members return FieldValueElementData objects:

Example

This example demonstrates how to handle the PivotGridControl.PopupMenuShowing event to create a context menu item with a command that displays the Top N Values for the selected row or column.

To determine whether the context menu appears for the Field Value, cast the PopupMenuShowingEventArgs.TargetElement to the FieldValueElement type. If the cast is successful, the resulting object’s DataAreaElement.ElementData property provides access to the FieldValueElementData object containing information on the target field.

Create a new bar item of the BarButtonItem type and store the FieldValueElementData object in the Tag property. Assign a custom handler to the BarItem.ItemClick event and add the bar item to the PopupMenuShowingEventArgs.Customizations collection.

Menu item’s BarItem.ItemClick event handler retrieves the previously saved FieldValueElementData object from the bar item’s Tag property. Subsequently, it uses the FieldValueElementData.PivotGrid property to get access to the PivotGridControl and call the PivotGridControl.GetFieldsByArea method to get all fields by area. The target field and its characteristics are obtained from the FieldValueElementData.Field, FieldValueElementData.DataField, and FieldValueElementData.MaxIndex properties. The PivotGridField.TopValueCount property value specifies the number of values to display.

FieldValueElementData_PopupMenuShowing

Note

The complete sample project How to Implement a Context Menu Action to Display Top 5 Values in a Column or Row is available in the DevExpress Examples repository.

Inheritance

Object
DispatcherObject
DependencyObject
DataAreaElementData
DevExpress.Xpf.PivotGrid.Internal.ScrollableAreaItemBase
FieldValueElementData
See Also