PivotGridControl.ShowingEditor Event

Allows you to cancel editor activation.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

public event EventHandler<CancelPivotCellEditEventArgs> ShowingEditor
Public Event ShowingEditor As EventHandler(Of CancelPivotCellEditEventArgs)

Event Data

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

Property Description
Cancel Gets or sets whether the event must be canceled.
ColumnCustomTotal Gets the column custom total which displays the current cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
ColumnField Gets the innermost column field which corresponds to the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
ColumnFieldIndex For internal use. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
ColumnIndex Gets the visual index of the column that contains the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
ColumnValueType Gets the type of column which contains the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
Data For internal use. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
DataField Gets the data field which identifies the column where the processed cell resides. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
Item For internal use. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
RepositoryItem Gets the repository item which identifies the settings of the in-place editor for the cell.
RowCustomTotal Gets the row custom total which contains the current cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
RowField Gets the innermost row field which corresponds to the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
RowFieldIndex For internal use. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
RowIndex Gets the index of the row that contains the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
RowValueType Gets the type of row which contains the processed cell. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
SummaryType Gets the summary type of the currently processed value. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
SummaryValue Gets the summary value currently being processed. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.
Value Gets the processed cell's value. Inherited from PivotCellEventArgsBase<TField, TData, TCustomTotal>.

Remarks

The ShowingEditor event is raised before a cell editor is activated, and allows you to cancel the operation. To do this, set the event parameter's CancelPivotCellEditEventArgs.Cancel property to true.

After the editor has been invoked, the PivotGridControl.ShownEditor event fires.

Use the following event parameter's properties to identify the cell where the editor is about to be invoked:

Examples

The following code shows how to disable data editing for total cells. This is accomplished by handling the PivotGridControl.ShowingEditor event. When handling this event, the type of the current cell can be identified via the PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnValueType and PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType parameters.

using DevExpress.XtraPivotGrid;

private void pivotGridControl1_ShowingEditor(object sender, CancelPivotCellEditEventArgs e) {
    if (e.RowValueType != PivotGridValueType.Value || e.ColumnValueType != PivotGridValueType.Value)
        e.Cancel = true;
}
See Also