Changeset 12689 for branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
- Timestamp:
- 07/08/15 15:32:12 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
-
branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/stable/HeuristicLab.DataPreprocessing.Views merged eligible /trunk/sources/HeuristicLab.DataPreprocessing.Views merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.DataPreprocessing.Views 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.DataPreprocessing.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.DataPreprocessing.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.DataPreprocessing.Views 4656-4721 /branches/CodeEditor/HeuristicLab.DataPreprocessing.Views 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.DataPreprocessing.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.DataPreprocessing.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.DataPreprocessing.Views 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views 10085-11101 /branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views 12054-12675 /branches/GP.Grammar.Editor/HeuristicLab.DataPreprocessing.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.DataPreprocessing.Views 5060 /branches/HLScript/HeuristicLab.DataPreprocessing.Views 10331-10358 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.DataPreprocessing.Views 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.DataPreprocessing.Views 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.DataPreprocessing.Views 10202-10483 /branches/NET40/sources/HeuristicLab.DataPreprocessing.Views 5138-5162 /branches/NSGA-II Changes/HeuristicLab.DataPreprocessing.Views 12033-12122 /branches/ParallelEngine/HeuristicLab.DataPreprocessing.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.DataPreprocessing.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.DataPreprocessing.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.DataPreprocessing.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.DataPreprocessing.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.DataPreprocessing.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.DataPreprocessing.Views 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.DataPreprocessing.Views 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.DataPreprocessing.Views 5370-5682 /branches/Trunk/HeuristicLab.DataPreprocessing.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.DataPreprocessing.Views 9168-9215 /branches/VNS/HeuristicLab.DataPreprocessing.Views 5594-5752 /branches/histogram/HeuristicLab.DataPreprocessing.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r12012 r12689 61 61 dataGridView.KeyDown += dataGridView_KeyDown; 62 62 dataGridView.MouseUp += dataGridView_MouseUp; 63 dataGridView.ColumnHeaderMouseClick += dataGridView_ColumnHeaderMouseClick;64 63 contextMenuCell.Items.Add(ShowHideColumns); 65 64 _highlightedCellsBackground = new Dictionary<int, IList<int>>(); … … 127 126 128 127 string errorMessage; 129 if ( Content != null) {128 if (!String.IsNullOrEmpty(e.FormattedValue.ToString())) { 130 129 if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered) { 131 130 errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode."; … … 164 163 } 165 164 166 private void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 165 protected override void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 166 if (Content != null) { 167 if (e.Button == System.Windows.Forms.MouseButtons.Left) { 168 dataGridView.Focus(); 169 dataGridView.ClearSelection(); 170 dataGridView.SelectionChanged -= dataGridView_SelectionChanged; 171 for (int i = 0; i < dataGridView.RowCount; i++) { 172 if (i + 1 == dataGridView.RowCount) 173 dataGridView.SelectionChanged += dataGridView_SelectionChanged; 174 dataGridView[e.ColumnIndex, i].Selected = true; 175 } 176 } else if (Content.SortableView) { 177 SortColumn(e.ColumnIndex); 178 } 179 } 167 180 searchIterator = null; 168 181 } … … 437 450 private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 438 451 if (Content == null) return; 439 if (e.Button == System.Windows.Forms.MouseButtons.Right ) {452 if (e.Button == System.Windows.Forms.MouseButtons.Right && !(e.ColumnIndex != -1 && e.RowIndex == -1)) { 440 453 if (e.ColumnIndex == -1 || e.RowIndex == -1) { 441 454 replaceValueOverColumnToolStripMenuItem.Visible = false; … … 474 487 private void dataGridView_KeyDown(object sender, KeyEventArgs e) { 475 488 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(); 489 var selectedCells = dataGridView.SelectedCells; 490 if (!Content.FilterLogic.IsFiltered) { //data is in read only mode.... 491 if (e.KeyCode == Keys.Delete && selectedCells.Count == Content.Rows && selectedCells.Count > 0) { 492 Content.DeleteColumn(selectedCells[0].ColumnIndex); 493 } else if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) { 494 List<int> rows = new List<int>(); 495 for (int i = 0; i < selectedRows.Count; ++i) { 496 int index = (sortedColumnIndices.Count != 0) ? (Convert.ToInt32(selectedRows[i].HeaderCell.Value) - 1) : 497 selectedRows[i].Index; 498 rows.Add(index); 499 } 500 Content.DeleteRows(rows); 501 } else if (e.Control && e.KeyCode == Keys.F) { 502 CreateFindAndReplaceDialog(); 503 findAndReplaceDialog.ActivateSearch(); 504 } else if (e.Control && e.KeyCode == Keys.R) { 505 CreateFindAndReplaceDialog(); 506 findAndReplaceDialog.ActivateReplace(); 507 } 488 508 } 489 509 }
Note: See TracChangeset
for help on using the changeset viewer.