Enables you to control whether the dragged field header can be dropped at the area it's currently located over.
public event PivotAreaChangingEventHandler FieldAreaChanging
Public Event FieldAreaChanging As PivotAreaChangingEventHandler
The FieldAreaChanging event's data class is PivotAreaChangingEventArgs. The following properties provide information specific to this event:
|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 PivotFieldEventArgsBase<T>.|
|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.|
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 customization form hides this field. In this case, field's PivotGridFieldBase.Visible property becomes false, but the PivotGridFieldBase.Area property remains unchanged. For example, you hide a field from the Data Area. The field's PivotGridFieldBase.Area property value is still DataArea, but its PivotGridFieldBase.Visible property is changed to false.
This event lets you prevent the field from being dropped at the current location. To prevent dropping, set the PivotAreaChangingEventArgs.Allow parameter to false. This changes the mouse cursor to which indicates that the field cannot be dropped at the area it's currently located over.
The field whose position is being changed and its current position are identified by the PivotFieldEventArgsBase<T>.Field, PivotAreaChangingEventArgs.NewArea and PivotAreaChangingEventArgs.NewAreaIndex properties, respectively.