protected override void RemoveItem(int columnIndex) { // if (this._owningGrid.InDisplayIndexAdjustments) { // We are within columns display indexes adjustments. We do not allow changing the column collection while adjusting display indexes. throw DataGridError.DataGrid.CannotChangeColumnCollectionWhileAdjustingDisplayIndexes(); } Debug.Assert(columnIndex >= 0 && columnIndex < this.ItemsInternal.Count); Debug.Assert(this._owningGrid != null); DataGridColumnBase dataGridColumn = this.ItemsInternal[columnIndex]; // DataGridCellCoordinates newCurrentCellCoordinates = this._owningGrid.OnRemovingColumn(dataGridColumn); InvalidateCachedColumnsOrder(); this.ItemsInternal.RemoveAt(columnIndex); dataGridColumn.OwningGrid = null; this._owningGrid.OnRemovedColumn_PreNotification(dataGridColumn); this._owningGrid.OnColumnCollectionChanged_PreNotification(false /*columnsGrew*/); base.RemoveItem(columnIndex); this._owningGrid.OnRemovedColumn_PostNotification(newCurrentCellCoordinates); this._owningGrid.OnColumnCollectionChanged_PostNotification(false /*columnsGrew*/); }
public override bool Equals(object o) { DataGridCellCoordinates dataGridCellCoordinates = o as DataGridCellCoordinates; if (dataGridCellCoordinates != null) { return(dataGridCellCoordinates.ColumnIndex == this.ColumnIndex && dataGridCellCoordinates.RowIndex == this.RowIndex); } return(false); }
public DataGridCellCoordinates(DataGridCellCoordinates dataGridCellCoordinates) : this(dataGridCellCoordinates.ColumnIndex, dataGridCellCoordinates.RowIndex) { }