public void AddSelectedCell(UltraGridCell cell) { if (SelectedCells.Where(x => x.RowIndex == cell.RowIndex && x.Key == cell.Key).Count() == 0) { var cloneCell = Container.Resolve <UltraGridCell>(cell.Row); cloneCell.Key = cell.Key; cloneCell.RowIndex = cell.RowIndex; SelectedCells.Add(cloneCell); } }
protected override void OnKeyUp(KeyEventArgs e) { switch (e.Key) { case Key.Delete: foreach (var cell in SelectedCells.Where(x => !x.Column.IsReadOnly)) { // N.B. Passing in an integer value of zero results in the Gas (MCF) column updating, // but no other column updating. Using a string "0" results in all values // updating properly. Very odd behaviour, but insufficient time to investigate why. cell.Column.OnPastingCellClipboardContent(cell.Item, "0"); } OnBeginningEdit(new DataGridBeginningEditEventArgs(Columns.First(), new DataGridRow(), new RoutedEventArgs())); break; case Key.Enter: OnBeginningEdit(new DataGridBeginningEditEventArgs(Columns.First(), new DataGridRow(), new RoutedEventArgs())); break; default: base.OnKeyUp(e); break; } }