private void OnColumnChanged(object sender, DataColumnChangeEventArgs e) { if (_updateController.NotUpdating && SetCellValue != null) { using (_updateController.BeginUpdating()) { DependentDataRow row = e.Row[TAG_COLUMN_NAME] as DependentDataRow; object tag = null; if (row != null) { tag = row.Tag; } // If no row exists yet, create one. else if (RowAdded != null) { tag = RowAdded(); _newTag = tag; _newRow = e.Row; } // Set the cell value. if (tag != null) { SetCellValue(tag, e.Column.Ordinal, e.ProposedValue); } } } }
public void Dispose() { _depValue.Dispose(); using (_updateController.BeginUpdating()) { if (_dataRow != null) { int rowIndex = _table.Rows.IndexOf(_dataRow); if (rowIndex >= 0) { _table.Rows.RemoveAt(rowIndex); } } } }