Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/06/15 16:41:59 (9 years ago)
Author:
pfleck
Message:

#2486
Allows pasting of multiple values that extend the current data limits (rows and/or columns).
In case, additional rows and columns are added with the default value of the column's type.

Location:
trunk/sources/HeuristicLab.DataPreprocessing/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridContent.cs

    r12676 r12983  
    7575      }
    7676      set {
    77         //not supported
     77        throw new NotSupportedException();
    7878      }
    7979    }
     
    8484      }
    8585      set {
    86         //not supported
     86        throw new NotSupportedException();
    8787      }
    8888    }
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs

    r12012 r12983  
    9898    public override void SetCell<T>(int columnIndex, int rowIndex, T value) {
    9999      SaveSnapshot(DataPreprocessingChangedEventType.ChangeItem, columnIndex, rowIndex);
     100
     101      for (int i = Rows; i <= rowIndex; i++)
     102        InsertRow(i);
     103      for (int i = Columns; i <= columnIndex; i++)
     104        InsertColumn<T>(i.ToString(), i);
     105
    100106      variableValues[columnIndex][rowIndex] = value;
    101107      if (!IsInTransaction)
     
    116122
    117123    public override bool VariableHasType<T>(int columnIndex) {
    118       return variableValues[columnIndex] is List<T>;
     124      return columnIndex >= variableValues.Count || variableValues[columnIndex] is List<T>;
    119125    }
    120126
     
    242248    public override void InsertColumn<T>(string variableName, int columnIndex) {
    243249      SaveSnapshot(DataPreprocessingChangedEventType.DeleteColumn, columnIndex, -1);
    244       variableValues.Insert(columnIndex, new List<T>(Rows));
     250      variableValues.Insert(columnIndex, new List<T>(Enumerable.Repeat(default(T), Rows)));
    245251      variableNames.Insert(columnIndex, variableName);
    246252      if (!IsInTransaction)
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs

    r12676 r12983  
    6363      var inputVariables = oldProblemData.InputVariables.ToDictionary(x => x.Value, x => x);
    6464      foreach (var variable in problemData.InputVariables) {
    65         bool isChecked = oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]);
     65        bool isChecked = oldProblemData.InputVariables.Contains(variable) && oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]);
    6666        problemData.InputVariables.SetItemCheckedState(variable, isChecked);
    6767      }
Note: See TracChangeset for help on using the changeset viewer.