Changeset 17226 for branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
- Timestamp:
- 08/29/19 15:57:35 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Core.Views
- Property svn:mergeinfo changed
/branches/2435-alglib_3_15/HeuristicLab.Core.Views (added) merged: 17034 /trunk/HeuristicLab.Core.Views merged: 16992,16997,17007-17009,17015,17037,17118,17126-17127,17180,17184
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r16723 r17226 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 104 104 if (Content != null) { 105 105 Caption += " (" + Content.GetType().Name + ")"; 106 foreach (T item in Content )106 foreach (T item in Content.OrderBy(x => x.ToString())) 107 107 AddListViewItem(CreateListViewItem(item)); 108 108 AdjustListViewColumnSizes(); 109 SortItemsListView(SortOrder.Ascending);110 109 } 111 110 } … … 221 220 protected virtual void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 222 221 removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0; 223 AdjustListViewColumnSizes();224 222 if (showDetailsCheckBox.Checked) { 225 223 if (itemsListView.SelectedItems.Count == 1) { … … 250 248 Clipboard.SetText(builder.ToString()); 251 249 } 250 } else if (itemsListView.MultiSelect && e.KeyData == (Keys.A | Keys.Control)) { 251 try { 252 itemsListView.BeginUpdate(); 253 foreach (ListViewItem item in itemsListView.Items) 254 item.Selected = true; 255 } finally { itemsListView.EndUpdate(); } 252 256 } 253 257 } … … 327 331 } 328 332 } 333 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 334 if (itemsListView.Columns.Count == 1) 335 AdjustListViewColumnSizes(); 336 } 329 337 #endregion 330 338 … … 423 431 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 424 432 UpdateListViewItemText(listViewItem); 425 AdjustListViewColumnSizes(); 433 if (itemsListView.Columns.Count > 1) 434 AdjustListViewColumnSizes(); 426 435 } 427 436 } … … 435 444 } 436 445 protected virtual void AdjustListViewColumnSizes() { 437 if (itemsListView.Items.Count > 0) { 438 for (int i = 0; i < itemsListView.Columns.Count; i++) 439 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 446 if (itemsListView.Columns.Count == 1) { 447 if (itemsListView.Columns[0].Width != itemsListView.ClientSize.Width) 448 itemsListView.Columns[0].Width = itemsListView.ClientSize.Width; 449 } else { 450 if (itemsListView.Items.Count > 0) { 451 for (int i = 0; i < itemsListView.Columns.Count; i++) 452 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 453 } 440 454 } 441 455 }
Note: See TracChangeset
for help on using the changeset viewer.