Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/12 16:39:51 (12 years ago)
Author:
sforsten
Message:

#1825: new columns are now inserted next to the selected one. If no column is selected, the new column is inserted at the end

File:
1 edited

Legend:

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

    r7267 r7732  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    25 using System.Text;
    26 using System.Xml;
    2724using HeuristicLab.DataImporter.Data.CommandBase;
    2825using HeuristicLab.DataImporter.Data.Model;
    29 using HeuristicLab.DataImporter.Data;
    3026using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3127
     
    6965      newColumn = (ColumnBase)Activator.CreateInstance(ColumnType, new object[] { this.ColumnName });
    7066      newColumn.Resize(ColumnGroup.RowCount);
    71       ColumnGroup.AddColumn(NewColumn);
     67
     68      ColumnBase cb = ColumnGroup.Columns.Where(x => x.Selected).FirstOrDefault();
     69      if (cb != null) {
     70        ColumnGroup.InsertColumn(ColumnGroup.IndexOfColumn(cb) + 1, NewColumn);
     71      } else {
     72        ColumnGroup.AddColumn(NewColumn);
     73      }
    7274      ColumnGroup.FireChanged();
    7375      ColumnGroup = null;
Note: See TracChangeset for help on using the changeset viewer.