Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.cs @ 10246

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
2using System.Windows.Forms;
3using HeuristicLab.Core.Views;
4using HeuristicLab.MainForm;
5using HeuristicLab.MainForm.WindowsForms;
6using HeuristicLab.Problems.DataAnalysis;
7using HeuristicLab.Data.Views;
8
9namespace 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.