Changeset 16888
- Timestamp:
- 05/02/19 13:10:57 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/NamedIntervalsView.cs
r16887 r16888 125 125 126 126 private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { 127 // DISABLED VALIDATION OF ENTRIES128 // because it leads to problems when updating the table129 // we can assume it's the users fault if he or she enters incorrect values130 131 if (dataGridView.Rows[e.RowIndex].IsNewRow) {132 return;133 }134 135 127 if (!double.TryParse(e.FormattedValue.ToString(), out var value)) { 136 128 e.Cancel = true; 137 129 dataGridView.Rows[e.RowIndex].ErrorText = "Value must be a double value."; 138 } else if (string.IsNullOrEmpty(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString()) || 130 return; 131 }/* else if (string.IsNullOrEmpty(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString()) || 139 132 string.IsNullOrEmpty(dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString())) { 140 133 // accept any value if one of the cells is still empty 141 } else {142 var l eft= double.Parse(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString());143 var right= double.Parse(dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString());144 if (e.ColumnIndex == 1 && value < l eft || e.ColumnIndex == 0 && value > right) {134 } */else { 135 var lowerBound = double.Parse(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString()); 136 var upperBound = double.Parse(dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString()); 137 if (e.ColumnIndex == 1 && value < lowerBound || e.ColumnIndex == 0 && value > upperBound) { 145 138 e.Cancel = true; 146 139 dataGridView.Rows[e.RowIndex].ErrorText = "Lower bound of interval must be smaller than upper bound.";
Note: See TracChangeset
for help on using the changeset viewer.