Skip to main content
A newer version of this page is available. .

ColumnView.CellValueChanged Event

Fires immediately after a cell’s value has been changed.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v18.1.dll

Declaration

[DXCategory("Property Changed")]
public event CellValueChangedEventHandler CellValueChanged

Event Data

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

Property Description
Column Gets the column that contains the processed cell.
RowHandle Gets the handle of the row that contains the processed cell.
Value Gets the current cell value.

Remarks

The CellValueChanged event fires in response to a cell’s value being changed. The list below gives the possible reasons for this event being raised:

  • An end-user has closed an in-place editor after changing the editor’s value.
  • A cell’s value has been changed using the methods provided by Views. For instance, the ColumnView.SetRowCellValue method can be used for this purpose.

The event doesn’t fire when a cell’s value is changed using the methods provided by the data source.

Example

The following sample code handles the ColumnView.CellValueChanged event to update the FullName column value after the FirstName column value has been changed.

using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.BandedGrid;

private void bandedGridView1_CellValueChanged(object sender, CellValueChangedEventArgs e) {
    BandedGridView view = sender as BandedGridView;
    if (view == null) return;
    if (e.Column.Caption != "FirstName") return;
    string cellValue = e.Value.ToString() + " " + view.GetRowCellValue(e.RowHandle, view.Columns["LastName"]).ToString();
    view.SetRowCellValue(e.RowHandle, view.Columns["FullName"], cellValue);
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the CellValueChanged event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also