Changeset 10965
- Timestamp:
- 06/11/14 10:42:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r10964 r10965 80 80 } 81 81 82 private void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) {83 searchIterator = null;84 }85 #region methods which override/modify methods from PreprocessingStringConvertibleMatrixView86 87 protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {88 if (Content != null) {89 if (!isSearching && !isReplacing) {90 91 if (Control.MouseButtons == MouseButtons.Left) {92 updateOnMouseUp = true;93 return;94 }95 96 base.dataGridView_SelectionChanged(sender, e);97 98 Content.DataGridLogic.SetSelection(GetSelectedCells());99 }100 }101 }102 103 protected override void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {104 if (!dataGridView.ReadOnly) {105 string errorMessage;106 if (Content != null) {107 if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered) {108 errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode.";109 } else {110 Content.DataGridLogic.Validate(e.FormattedValue.ToString(), out errorMessage, e.ColumnIndex);111 }112 113 if (!String.IsNullOrEmpty(errorMessage)) {114 e.Cancel = true;115 dataGridView.Rows[e.RowIndex].ErrorText = errorMessage;116 }117 }118 }119 }120 121 protected override void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) {122 triggersOwnEvent(() => base.dataGridView_CellParsing(sender, e));123 }124 125 protected override void PasteValuesToDataGridView() {126 triggersOwnEvent(() => base.PasteValuesToDataGridView());127 }128 129 protected override void SetEnabledStateOfControls() {130 base.SetEnabledStateOfControls();131 rowsTextBox.ReadOnly = true;132 columnsTextBox.ReadOnly = true;133 }134 135 protected override int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {136 btnApplySort.Enabled = sortedColumns.Any();137 return base.Sort(sortedColumns);138 }139 140 protected override void ClearSorting() {141 btnApplySort.Enabled = false;142 base.ClearSorting();143 }144 145 #endregion146 147 82 protected override void OnContentChanged() { 148 83 List<KeyValuePair<int, SortOrder>> order = new List<KeyValuePair<int, SortOrder>>(base.sortedColumnIndices); … … 199 134 } 200 135 } 136 searchIterator = null; 137 } 138 139 #region methods which override/modify methods from PreprocessingStringConvertibleMatrixView 140 141 protected override void dataGridView_SelectionChanged(object sender, EventArgs e) { 142 if (Content != null) { 143 if (!isSearching && !isReplacing) { 144 145 if (Control.MouseButtons == MouseButtons.Left) { 146 updateOnMouseUp = true; 147 return; 148 } 149 150 base.dataGridView_SelectionChanged(sender, e); 151 152 Content.DataGridLogic.SetSelection(GetSelectedCells()); 153 } 154 } 155 } 156 157 protected override void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { 158 if (!dataGridView.ReadOnly) { 159 string errorMessage; 160 if (Content != null) { 161 if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered) { 162 errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode."; 163 } else { 164 Content.DataGridLogic.Validate(e.FormattedValue.ToString(), out errorMessage, e.ColumnIndex); 165 } 166 167 if (!String.IsNullOrEmpty(errorMessage)) { 168 e.Cancel = true; 169 dataGridView.Rows[e.RowIndex].ErrorText = errorMessage; 170 } 171 } 172 } 173 } 174 175 protected override void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) { 176 triggersOwnEvent(() => base.dataGridView_CellParsing(sender, e)); 177 } 178 179 protected override void PasteValuesToDataGridView() { 180 triggersOwnEvent(() => base.PasteValuesToDataGridView()); 181 } 182 183 protected override void SetEnabledStateOfControls() { 184 base.SetEnabledStateOfControls(); 185 rowsTextBox.ReadOnly = true; 186 columnsTextBox.ReadOnly = true; 187 } 188 189 protected override int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) { 190 btnApplySort.Enabled = sortedColumns.Any(); 191 return base.Sort(sortedColumns); 192 } 193 194 protected override void ClearSorting() { 195 btnApplySort.Enabled = false; 196 base.ClearSorting(); 197 } 198 199 #endregion 200 201 private void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 201 202 searchIterator = null; 202 203 }
Note: See TracChangeset
for help on using the changeset viewer.