- Timestamp:
- 11/15/10 15:26:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r4779 r4798 134 134 else 135 135 dataGridView.ColumnCount = Content.Columns; 136 136 137 ClearSorting(); 137 138 … … 145 146 146 147 protected void UpdateColumnHeaders() { 147 HashSet<string> visibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>() 148 .Where(c => c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText)); 149 if (!visibleColumnNames.Intersect(Content.ColumnNames).Any()) 150 visibleColumnNames.Clear(); 148 HashSet<string> invisibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>() 149 .Where(c => !c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText)); 151 150 152 151 for (int i = 0; i < dataGridView.ColumnCount; i++) { … … 155 154 else 156 155 dataGridView.Columns[i].HeaderText = "Column " + (i + 1); 157 } 158 159 foreach (DataGridViewColumn column in dataGridView.Columns) 160 column.Visible = visibleColumnNames.Contains(column.HeaderText) || visibleColumnNames.Count == 0; 156 dataGridView.Columns[i].Visible = !invisibleColumnNames.Contains(dataGridView.Columns[i].HeaderText); 157 } 161 158 } 162 159 protected void UpdateRowHeaders() {
Note: See TracChangeset
for help on using the changeset viewer.