Last change
on this file since 10246 was
10246,
checked in by rstoll, 10 years ago
|
- Moved logic from DataGridContent to DataGridContentLogic
- Created interface for IPreprocessingDataManipulation
|
File size:
1.1 KB
|
Line | |
---|
1 |
|
---|
2 | using System.Windows.Forms;
|
---|
3 | using HeuristicLab.Core.Views;
|
---|
4 | using HeuristicLab.MainForm;
|
---|
5 | using HeuristicLab.MainForm.WindowsForms;
|
---|
6 | using HeuristicLab.Problems.DataAnalysis;
|
---|
7 | using HeuristicLab.Data.Views;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.DataPreprocessing {
|
---|
10 | [View("Data Grid Content View")]
|
---|
11 | [Content(typeof(IDataGridContent), false)]
|
---|
12 | public partial class DataGridContentView : StringConvertibleMatrixView {
|
---|
13 |
|
---|
14 | public new IDataGridContent Content {
|
---|
15 | get { return (IDataGridContent)base.Content; }
|
---|
16 | set { base.Content = value; }
|
---|
17 | }
|
---|
18 |
|
---|
19 | public DataGridContentView() {
|
---|
20 | InitializeComponent();
|
---|
21 | }
|
---|
22 |
|
---|
23 | protected override void OnContentChanged() {
|
---|
24 | base.OnContentChanged();
|
---|
25 |
|
---|
26 | }
|
---|
27 |
|
---|
28 | private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
|
---|
29 | if (!dataGridView.ReadOnly) {
|
---|
30 | string errorMessage;
|
---|
31 | if (Content != null && !Content.DataGridLogic.Validate(e.FormattedValue.ToString(), out errorMessage, e.ColumnIndex)) {
|
---|
32 | e.Cancel = true;
|
---|
33 | dataGridView.Rows[e.RowIndex].ErrorText = errorMessage;
|
---|
34 | }
|
---|
35 | }
|
---|
36 | }
|
---|
37 | }
|
---|
38 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.