Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9523


Ignore:
Timestamp:
05/24/13 14:17:56 (12 years ago)
Author:
ascheibe
Message:

#2064 fixed sorting in Hive Job Manager and ItemCollectionView

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ListViewItemDateComparer.cs

    r9456 r9523  
    3131  public class ListViewItemDateComparer : IComparer {
    3232    private int col;
    33     private SortOrder order;
     33    public SortOrder Order { get; set; }
    3434
    3535    public ListViewItemDateComparer() {
    3636      col = 0;
    37       order = SortOrder.Ascending;
     37      Order = SortOrder.Ascending;
    3838    }
    3939
    4040    public ListViewItemDateComparer(int column, SortOrder order) {
    4141      col = column;
    42       this.order = order;
     42      Order = order;
    4343    }
    4444
     
    6666      }
    6767
    68       if (order == SortOrder.Descending) {
     68      if (Order == SortOrder.Descending) {
    6969        // invert the value returned by Compare.
    7070        returnVal *= -1;
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r9456 r9523  
    4444      this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" });
    4545      this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" });
    46       foreach (ColumnHeader c in this.itemsListView.Columns) {
    47         c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
    48       }
     46
    4947      this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable;
    5048      this.itemsListView.FullRowSelect = true;
    5149
    5250      this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending);
    53       this.itemsListView.Sorting = SortOrder.Ascending;
    54       this.itemsListView.Sort();
    5551
    5652      progress = new Progress() {
     
    5955      };
    6056      progressView = new ProgressView(this, progress);
     57    }
     58
     59    protected override void SortItemsListView(SortOrder sortOrder) {
     60      if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return;
     61      ((ListViewItemDateComparer)itemsListView.ListViewItemSorter).Order = sortOrder;
     62      base.SortItemsListView(sortOrder);
     63      AdjustListViewColumnSizes();
    6164    }
    6265
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r9456 r9523  
    407407    #region Helpers
    408408    protected virtual void SortItemsListView(SortOrder sortOrder) {
    409       itemsListView.Sorting = SortOrder.None;
     409      if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return;
    410410      itemsListView.Sorting = sortOrder;
    411       itemsListView.Sorting = SortOrder.None;
     411      itemsListView.Sort();
    412412    }
    413413    protected virtual void AdjustListViewColumnSizes() {
Note: See TracChangeset for help on using the changeset viewer.