- Timestamp:
- 05/27/20 15:45:50 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.cs
r17145 r17564 21 21 22 22 23 using System.Linq;24 23 using System.Windows.Forms; 25 24 using HeuristicLab.MainForm; … … 69 68 70 69 71 var variablesCount = Content. GetIntervals().Count;70 var variablesCount = Content.Count; 72 71 73 72 DataGridViewRow[] rows = new DataGridViewRow[variablesCount]; … … 78 77 dataGridView.Rows.AddRange(rows); 79 78 80 SetRowsHeader(); 81 FillRows(); 79 int j = 0; 80 foreach (var variableInterval in Content.GetVariableIntervals()) { 81 dataGridView.Rows[j].HeaderCell.Value = variableInterval.Item1; 82 dataGridView.Rows[j].Cells[0].Value = variableInterval.Item2.LowerBound; 83 dataGridView.Rows[j].Cells[1].Value = variableInterval.Item2.UpperBound; 84 j++; 85 } 82 86 83 87 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); … … 87 91 foreach (DataGridViewColumn column in dataGridView.Columns) { 88 92 column.SortMode = DataGridViewColumnSortMode.NotSortable; 89 }90 }91 92 private void FillRows() {93 for (var i = 0; i < dataGridView.RowCount; ++i) {94 var key = (string)dataGridView.Rows[i].HeaderCell.Value;95 dataGridView.Rows[i].Cells[0].Value = Content.GetInterval(key).LowerBound;96 dataGridView.Rows[i].Cells[1].Value = Content.GetInterval(key).UpperBound;97 }98 }99 100 private void SetRowsHeader() {101 for (var i = 0; i < Content.GetIntervals().Count; ++i) {102 var item = Content.GetIntervals().ElementAt(i);103 dataGridView.Rows[i].HeaderCell.Value = item.Key;104 93 } 105 94 }
Note: See TracChangeset
for help on using the changeset viewer.