Changeset 168 for trunk/sources/HeuristicLab.DataAnalysis
- Timestamp:
- 04/23/08 00:35:19 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs
r2 r168 33 33 set { 34 34 Item = value; 35 Item.Changed += new EventHandler(Item_Changed);35 Refresh(); 36 36 } 37 37 } 38 38 39 void Item_Changed(object sender, EventArgs e) { 40 Refresh(); 41 } 42 43 public DatasetView() : base() { 39 public DatasetView() 40 : base() { 44 41 InitializeComponent(); 45 42 openFileDialog = new OpenFileDialog(); 46 43 } 47 44 48 public DatasetView(Dataset dataset) :this() { 45 public DatasetView(Dataset dataset) 46 : this() { 49 47 this.Dataset = dataset; 50 48 } … … 52 50 protected override void UpdateControls() { 53 51 base.UpdateControls(); 54 if (Dataset != null) {52 if (Dataset != null) { 55 53 int rows = Dataset.Rows; 56 54 int columns = Dataset.Columns; 57 58 55 nameTextBox.Text = Dataset.Name; 59 56 rowsTextBox.Text = rows + ""; … … 61 58 dataGridView.ColumnCount = columns; 62 59 dataGridView.RowCount = rows; 63 for (int i = 0; i < rows; i++) {64 for (int j = 0; j < columns; j++) {60 for (int i = 0; i < rows; i++) { 61 for (int j = 0; j < columns; j++) { 65 62 dataGridView.Rows[i].Cells[j].Value = Dataset.GetValue(i, j); 66 63 } … … 85 82 86 83 private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { 87 if (ValidateData((string)e.FormattedValue)) {84 if (ValidateData((string)e.FormattedValue)) { 88 85 SetArrayElement(e.RowIndex, e.ColumnIndex, (string)e.FormattedValue); 89 86 e.Cancel = false; … … 97 94 double result; 98 95 double.TryParse(element, out result); 99 if (result != Dataset.GetValue(row, column)) {96 if (result != Dataset.GetValue(row, column)) { 100 97 Dataset.SetValue(row, column, result); 101 98 Dataset.FireChanged();
Note: See TracChangeset
for help on using the changeset viewer.