The event handler receives an argument of type CustomEditValueEventArgs containing data related to this event.
The following
CustomEditValueEventArgs properties provide information specific to this event.
Property |
Description |
ColumnCustomTotal |
Gets the column custom total which displays the current cell. |
ColumnField |
Gets the innermost column field which corresponds to the processed cell. |
ColumnFieldIndex |
For internal use. |
ColumnIndex |
Gets the visual index of the column that contains the processed cell. |
ColumnValueType |
Gets the type of column which contains the processed cell. |
Data |
For internal use.
|
DataField |
Gets the data field which identifies the column where the processed cell resides. |
Item |
For internal use. |
RowCustomTotal |
Gets the row custom total which contains the current cell. |
RowField |
Gets the innermost row field which corresponds to the processed cell. |
RowFieldIndex |
For internal use. |
RowIndex |
Gets the index of the row that contains the processed cell. |
RowValueType |
Gets the type of row which contains the processed cell. |
SummaryType |
Gets the summary type of the currently processed value. |
SummaryValue |
Gets the summary value currently being processed. |
Value |
Gets or sets the edit value of the processed cell. |
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 CustomCellEdit event.
Note
Cell values assigned in the CustomEditValue event handler are not posted to a data source. You can handle the EditValueChanged event to accomplish this.
Use the following properties to identify the edited cell:
- The DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnField, DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowField and DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.DataField properties return column, row and data fields related to the current cell.
- The DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnIndex and DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowIndex properties return the zero-based index of the cell's column or row. Note that the index is calculated based on visible rows or columns, thus collapsed and expanded rows/columns have different indexes.
- The DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnValueType and DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType properties return column adn row types.
- If the current cell is a custom total cell, the DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnCustomTotal and DevExpress.XtraPivotGrid.PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowCustomTotal properties return column and row custom totals. Otherwise, these properties return null (Nothing in Visual Basic).
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.
C# |
private void pivotGridControl_CustomEditValue(object sender, CustomEditValueEventArgs e) {
if(e.DataField == fieldPercents)
e.Value = Convert.ToDouble(e.Value) * 100f;
}
|
The image below shows the result:
