Changeset 8537
- Timestamp:
- 08/29/12 16:43:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DatasetFeatureCorrelation/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelationView.cs
r8529 r8537 79 79 PartitionComboBox.DataSource = Content.Partitions; 80 80 CalculateCorrelation(); 81 } else { 82 DataGridView.Columns.Clear(); 83 DataGridView.Rows.Clear(); 81 84 } 82 85 } … … 145 148 146 149 protected void DataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { 147 if (Content != null && DataGridView.Enabled && e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) { 148 int rowIndex = virtualRowIndices[e.RowIndex]; 149 e.Value = Content[rowIndex, e.ColumnIndex]; 150 } 150 if (Content == null) return; 151 int rowIndex = virtualRowIndices[e.RowIndex]; 152 e.Value = Content[rowIndex, e.ColumnIndex]; 151 153 } 152 154 153 155 protected void DataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { 154 if (Content != null && DataGridView.Enabled && e.RowIndex >= 0 && e.ColumnIndex >= 0 && e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) { 155 int rowIndex = virtualRowIndices[e.RowIndex]; 156 e.CellStyle.BackColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Content.Minimum, Content.Maximum); 157 } 158 e.Paint(e.CellBounds, e.PaintParts); 156 //if (Content != null && DataGridView.Enabled && e.RowIndex >= 0 && e.ColumnIndex >= 0 && e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) { 157 // int rowIndex = virtualRowIndices[e.RowIndex]; 158 //e.CellStyle.BackColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Content.Minimum, Content.Maximum); 159 //} 160 //e.Paint(e.CellBounds, e.PaintParts); 161 162 if (Content == null) return; 163 if (e.RowIndex < 0) return; 164 if (e.ColumnIndex < 0) return; 165 if (e.State.HasFlag(DataGridViewElementStates.Selected)) return; 166 if (!e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) return; 167 168 int rowIndex = virtualRowIndices[e.RowIndex]; 169 Color backColor = GetDataPointColor(Content[rowIndex, e.ColumnIndex], Content.Minimum, Content.Maximum); 170 using (Brush backColorBrush = new SolidBrush(backColor)) { 171 e.Graphics.FillRectangle(backColorBrush, e.CellBounds); 172 } 173 e.PaintContent(e.CellBounds); 174 e.Handled = true; 159 175 } 160 176
Note: See TracChangeset
for help on using the changeset viewer.