Changeset 12158
- Timestamp:
- 03/09/15 10:28:35 (10 years ago)
- Location:
- branches/DataPreprocessingImprovements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs ¶
r12012 r12158 438 438 if (Content == null) return; 439 439 if (e.Button == System.Windows.Forms.MouseButtons.Right) { 440 if (e.ColumnIndex != -1 && e.RowIndex == -1) { 441 dataGridView.Focus(); 442 dataGridView.ClearSelection(); 443 for (int r = 0; r < dataGridView.RowCount; r++) { 444 dataGridView[e.ColumnIndex, r].Selected = true; 445 } 446 return; 447 } 440 448 if (e.ColumnIndex == -1 || e.RowIndex == -1) { 441 449 replaceValueOverColumnToolStripMenuItem.Visible = false; … … 474 482 private void dataGridView_KeyDown(object sender, KeyEventArgs e) { 475 483 var selectedRows = dataGridView.SelectedRows; 476 if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) { 477 List<int> rows = new List<int>(); 478 for (int i = 0; i < selectedRows.Count; ++i) { 479 rows.Add(selectedRows[i].Index); 480 } 481 Content.DeleteRow(rows); 482 } else if (e.Control && e.KeyCode == Keys.F) { 483 CreateFindAndReplaceDialog(); 484 findAndReplaceDialog.ActivateSearch(); 485 } else if (e.Control && e.KeyCode == Keys.R) { 486 CreateFindAndReplaceDialog(); 487 findAndReplaceDialog.ActivateReplace(); 484 var selectedCells = dataGridView.SelectedCells; 485 if (!Content.FilterLogic.IsFiltered) { //data is in read only mode.... 486 if (e.KeyCode == Keys.Delete && selectedCells.Count == Content.Rows && selectedCells.Count > 0) { 487 Content.DeleteColumn(selectedCells[0].ColumnIndex); 488 } else if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) { 489 List<int> rows = new List<int>(); 490 for (int i = 0; i < selectedRows.Count; ++i) { 491 rows.Add(selectedRows[i].Index); 492 } 493 Content.DeleteRows(rows); 494 } else if (e.Control && e.KeyCode == Keys.F) { 495 CreateFindAndReplaceDialog(); 496 findAndReplaceDialog.ActivateSearch(); 497 } else if (e.Control && e.KeyCode == Keys.R) { 498 CreateFindAndReplaceDialog(); 499 findAndReplaceDialog.ActivateReplace(); 500 } 488 501 } 489 502 } -
TabularUnified branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridContent.cs ¶
r12012 r12158 114 114 } 115 115 116 public void DeleteRow (IEnumerable<int> rows) {116 public void DeleteRows(IEnumerable<int> rows) { 117 117 PreProcessingData.DeleteRowsWithIndices(rows); 118 118 createRowNames(); 119 } 120 121 public void DeleteColumn(int column) { 122 PreProcessingData.DeleteColumn(column); 119 123 } 120 124 -
TabularUnified branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing/3.4/Interfaces/IDataGridContent.cs ¶
r12012 r12158 31 31 IDictionary<int, IList<int>> Selection { get; set; } 32 32 33 void DeleteRow(IEnumerable<int> rows); 33 void DeleteRows(IEnumerable<int> rows); 34 void DeleteColumn(int column); 34 35 bool Validate(string value, out string errorMessage, int columnIndex); 35 36
Note: See TracChangeset
for help on using the changeset viewer.