Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9595


Ignore:
Timestamp:
06/06/13 14:50:43 (11 years ago)
Author:
mkommend
Message:

#2068: Corrected insert position in new column commands.

Location:
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeColumnGroup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeColumnGroup/AddNewColumnCommandBase.cs

    r8676 r9595  
    4848
    4949    [Storable]
     50    private int columnIndex = -1;
     51    protected int ColumnIndex {
     52      get { return this.columnIndex; }
     53      set { this.columnIndex = value; }
     54    }
     55
     56    [Storable]
    5057    private string columnName;
    5158    protected string ColumnName {
     
    6673      newColumn.Resize(ColumnGroup.RowCount);
    6774
    68       ColumnBase cb = ColumnGroup.Columns.FirstOrDefault(x => x.Selected);
    69       if (cb != null) {
    70         ColumnGroup.InsertColumn(ColumnGroup.IndexOfColumn(cb) + 1, NewColumn);
     75      if (ColumnIndex == -1) {
     76        ColumnBase cb = ColumnGroup.Columns.FirstOrDefault(x => x.Selected);
     77        if (cb != null) ColumnIndex = ColumnGroup.IndexOfColumn(cb);
     78      }
     79      if (ColumnIndex != -1) {
     80        ColumnGroup.InsertColumn(ColumnIndex + 1, NewColumn);
    7181      } else {
    7282        ColumnGroup.AddColumn(NewColumn);
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/ChangeColumnGroup/AddNewProgrammableColumnCommand.cs

    r8676 r9595  
    6666      }
    6767
    68       ColumnBase cb = ColumnGroup.Columns.FirstOrDefault(x => x.Selected);
    69       if (cb != null) {
    70         ColumnGroup.InsertColumn(ColumnGroup.IndexOfColumn(cb) + 1, NewColumn);
     68      if (ColumnIndex == -1) {
     69        ColumnBase cb = ColumnGroup.Columns.FirstOrDefault(x => x.Selected);
     70        if (cb != null) ColumnIndex = ColumnGroup.IndexOfColumn(cb);
     71      }
     72      if (ColumnIndex != -1) {
     73        ColumnGroup.InsertColumn(ColumnIndex + 1, NewColumn);
    7174      } else {
    7275        ColumnGroup.AddColumn(NewColumn);
Note: See TracChangeset for help on using the changeset viewer.