Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/12 11:56:52 (12 years ago)
Author:
sforsten
Message:

#1818: the updating of the row headers is now done in the event CellFormatting of the DataGridView, which increases the performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.cs

    r7652 r7730  
    5858      this.dataGridView.RowHeadersWidthChanged += new EventHandler(dataGridView_RowHeadersWidthChanged);
    5959      this.dataGridView.CellMouseEnter += new DataGridViewCellEventHandler(dataGridView_CellMouseEnter);
     60      this.dataGridView.CellFormatting += new DataGridViewCellFormattingEventHandler(dataGridView_CellFormatting);
    6061
    6162      //delegates for virtual mode
     
    295296      }
    296297
    297       UpdateDataGridViewHeaderCells();
    298298      this.dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
    299299      this.dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
     
    311311      this.dataGridView.Invalidate();
    312312      UpdateStateInformation();
    313     }
    314 
    315     private void UpdateDataGridViewHeaderCells() {
    316       for (int i = 1; i <= columnGroup.RowCount; i++)
    317         dataGridView.Rows[i].HeaderCell.Value = i.ToString();
    318313    }
    319314
     
    474469    }
    475470
    476 
     471    private void dataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) {
     472      this.dataGridView.Rows[e.RowIndex].HeaderCell.Value = e.RowIndex.ToString();
     473    }
    477474
    478475    private string ToExcelColumnIndex(int index) {
Note: See TracChangeset for help on using the changeset viewer.