CellValueChangedEventArgs.Value Property

Gets the current cell value.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public object Value { get; }
Public ReadOnly Property Value As Object

Property Value

Type Description
Object

An object representing the current cell value.

Remarks

If handling the ColumnView.CellValueChanging event, the Value property represents the active editor's value. Note that this value can be later discarded by end-users or changed further. When handling the ColumnView.CellValueChanged event, the property returns the newly assigned cell value.

Examples

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);
}
See Also