PivotGridControl.CustomEditValue Event

Enables you to change cell values.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

public event CustomEditValueEventHandler CustomEditValue
Public Event CustomEditValue As CustomEditValueEventHandler

Event Data

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

Property Description
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>.
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 or sets the edit value of the processed cell.

Remarks

The CustomEditValue event occurs for each data cell that has an in-place editor assigned to it. This event raises each time the cell is repainted, allowing you to change its value. To specify a custom cell value, use the event parameter's CustomEditValueEventArgs.Value property. This property initially contains a summary value calculated for this cell.

To assign an editor to a cell, use the PivotGridField.FieldEdit property, or handle the PivotGridControl.CustomCellEdit event.

NOTE

Cell values assigned in the CustomEditValue event handler are not posted to a data source. You can handle the PivotGridControl.EditValueChanged event to accomplish this.

Use the following properties to identify the edited cell:

In the following example, the Percents of the Columns field's cells display the percentage of the column total value. Cell values are in the range from 0 to 1. The progress bar visualizes the percentage value. The CustomEditValue event handler translates the 0 to 1 range values to the 0 to 100 range that is acceptable for the progress bar.


private void pivotGridControl_CustomEditValue(object sender, CustomEditValueEventArgs e) {
    if(e.DataField == fieldPercents)
        // e.Value = 0.1502539532880652 (before)
        e.Value = Convert.ToDouble(e.Value) * 100f;
        // e.Value = 15 (after)
}

The image below shows the result:

CustomEditValue

See Also