Changeset 15992 for branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
- Timestamp:
- 07/10/18 23:06:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r14185 r15992 41 41 this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" }); 42 42 this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" }); 43 this.itemsListView.Columns.Add(new ColumnHeader("Project") { Text = "Project" }); 43 44 44 45 this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable; 45 46 this.itemsListView.FullRowSelect = true; 46 47 47 this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending); 48 this.itemsListView.ListViewItemSorter = new ListViewItemComparer(new int[] { 2, 0 }, new SortOrder[] { SortOrder.Ascending, SortOrder.Ascending }); 49 50 foreach (ColumnHeader c in this.itemsListView.Columns) { 51 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 52 int w = c.Width; 53 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 54 if(w > c.Width) { 55 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 56 } 57 } 48 58 } 49 59 50 60 protected override void SortItemsListView(SortOrder sortOrder) { 51 61 if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return; 52 ((ListViewItem DateComparer)itemsListView.ListViewItemSorter).Order= sortOrder;62 ((ListViewItemComparer)itemsListView.ListViewItemSorter).Orders[1] = sortOrder; 53 63 itemsListView.Sorting = sortOrder; 54 64 itemsListView.Sort(); 55 AdjustListViewColumnSizes();65 //AdjustListViewColumnSizes(); 56 66 } 57 67 … … 133 143 base.Content_ItemsAdded(sender, e); 134 144 foreach (ColumnHeader c in this.itemsListView.Columns) { 145 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 146 int w = c.Width; 135 147 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 148 if (w > c.Width) { 149 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 150 } 136 151 } 137 152 foreach (var item in e.Items) { … … 180 195 listViewItem.SubItems.Insert(0, new ListViewItem.ListViewSubItem(listViewItem, item.Job.DateCreated.ToString())); 181 196 listViewItem.SubItems.Insert(1, new ListViewItem.ListViewSubItem(listViewItem, item.Job.Name)); 197 listViewItem.SubItems.Insert(2, new ListViewItem.ListViewSubItem(listViewItem, HiveClient.Instance.GetProjectAncestry(item.Job.ProjectId))); 198 182 199 listViewItem.Group = GetListViewGroup(item.Job.OwnerUsername); 183 200 return listViewItem; … … 189 206 listViewItem.SubItems[0].Text = item == null ? "null" : item.Job.DateCreated.ToString("dd.MM.yyyy HH:mm"); 190 207 listViewItem.SubItems[1].Text = item == null ? "null" : item.Job.Name; 208 listViewItem.SubItems[2].Text = item == null ? "null" : HiveClient.Instance.GetProjectAncestry(item.Job.ProjectId); 191 209 listViewItem.Group = GetListViewGroup(item.Job.OwnerUsername); 192 210 listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
Note: See TracChangeset
for help on using the changeset viewer.