Changeset 4199
- Timestamp:
- 08/11/10 17:36:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r4178 r4199 34 34 [Content(typeof(IStringConvertibleMatrix), true)] 35 35 public partial class StringConvertibleMatrixView : AsynchronousContentView { 36 pr otectedint[] virtualRowIndizes;36 private int[] virtualRowIndizes; 37 37 private List<KeyValuePair<int, SortOrder>> sortedColumnIndizes; 38 38 private RowComparer rowComparer; … … 114 114 dataGridView.ColumnCount = Content.Columns; 115 115 116 UpdateColumnHeaders(); 116 117 UpdateRowHeaders(); 117 UpdateColumnHeaders(); 118 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader); 119 dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders); 118 120 dataGridView.Enabled = true; 119 dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders); 120 } 121 122 private void UpdateColumnHeaders() { 121 } 122 123 protected void UpdateColumnHeaders() { 123 124 for (int i = 0; i < dataGridView.ColumnCount; i++) { 124 125 if (Content.ColumnNames.Count() != 0) … … 127 128 dataGridView.Columns[i].HeaderText = "Column " + (i + 1); 128 129 } 129 dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader); 130 } 131 132 private void UpdateRowHeaders() { 133 int firstDisplayedRowIndex = dataGridView.FirstDisplayedScrollingRowIndex; 134 if (firstDisplayedRowIndex == -1) 135 firstDisplayedRowIndex = 0; 136 int lastDisplaydRowIndex = firstDisplayedRowIndex + dataGridView.DisplayedRowCount(true); 137 138 for (int i = firstDisplayedRowIndex; i < lastDisplaydRowIndex; i++) { 130 } 131 protected void UpdateRowHeaders() { 132 int index = dataGridView.FirstDisplayedScrollingRowIndex; 133 if (index == -1) index = 0; 134 int updatedRows = 0; 135 int count = dataGridView.DisplayedRowCount(true); 136 137 while (updatedRows < count) { 139 138 if (Content.RowNames.Count() != 0) 140 dataGridView.Rows[i ].HeaderCell.Value = Content.RowNames.ElementAt(virtualRowIndizes[i]);139 dataGridView.Rows[index].HeaderCell.Value = Content.RowNames.ElementAt(virtualRowIndizes[index]); 141 140 else 142 dataGridView.Rows[i].HeaderCell.Value = "Row " + (i + 1); 141 dataGridView.Rows[index].HeaderCell.Value = "Row " + (index + 1); 142 if (dataGridView.Rows[index].Visible) 143 updatedRows++; 144 index++; 143 145 } 144 146 }
Note: See TracChangeset
for help on using the changeset viewer.