private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (TransView.FocusedColumn.FieldName == "TValue") { int rHandle = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle); Decimal tValue = Convert.ToDecimal(TransView.GetRowCellValue(rHandle - 1, "TValue")); Decimal tCurValue = Convert.ToDecimal(TransView.GetRowCellValue(TransView.FocusedRowHandle, "TValue")); if (tCurValue <= tValue) { DataRow dr = TransView.GetDataRow(TransView.FocusedRowHandle); dr["TValue"] = 0; } } }