Skip to main content

PivotGridControl.FieldAreaChanging Event

Occurs before a field’s position is changed, allowing cancellation of this action.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v24.1.dll

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public event PivotFieldAreaChangingEventHandler FieldAreaChanging

Event Data

The FieldAreaChanging event's data class is PivotFieldAreaChangingEventArgs. The following properties provide information specific to this event:

Property Description
Allow Gets or sets whether the dragged field header can be dropped on the area it’s currently located over.
Field Gets the field being processed. Inherited from PivotFieldEventArgs.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
NewArea Gets the current position of the field being dragged.
NewAreaIndex Gets the index of the field which is being dragged for the area it’s currently located over among the other fields displayed within the area.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

Method Description
InvokeEventHandler(Delegate, Object) When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object) When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.

Remarks

End users can move fields from one area to another or reorder the fields within the same area by dragging their headers.The FieldAreaChanging event is raised before:

  • the area the dragged field header is currently located over is changed;
  • the field header’s position among the other headers within the same area is changed.

Dragging the field to the field list hides this field. In this case, field’s PivotGridField.Visible property becomes false, but the PivotGridField.Area property remains unchanged. For example, you hide a field from the Data Area. The field’s PivotGridField.Area property value is still DataArea, but its PivotGridField.Visible property is changed to false.

To prevent the field from being dropped at the position it’s currently located over, set the event parameter’s PivotFieldAreaChangingEventArgs.Allow property to false.

The field and its current position are identified by the PivotFieldEventArgs.Field, PivotFieldAreaChangingEventArgs.NewArea and PivotFieldAreaChangingEventArgs.NewAreaIndex properties, respectively.

See Also