Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/28/14 15:34:34 (10 years ago)
Author:
rstoll
Message:
  • Fixed FindAll -> selection was very slow, CopyOfStringConvertibleMatrix had registered an event as well which slowed down everything (more or less)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs

    r10911 r10916  
    7474      _highlightedCellsBackground = new Dictionary<int, IList<int>>();
    7575      currentCell = null;
    76       DataGridView.SelectionChanged += DataGridView_SelectionChanged;
    77     }
    78 
    79     void DataGridView_SelectionChanged(object sender, EventArgs e) {
    80       if (!isSearching && Content != null) {
    81         Content.DataGridLogic.SetSelection(GetSelectedCells());
     76    }
     77
     78    protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {
     79      if (Content != null) {
     80        if (!isSearching) {
     81          base.dataGridView_SelectionChanged(sender, e);
     82          Content.DataGridLogic.SetSelection(GetSelectedCells());
     83        }
    8284      }
    8385    }
     
    103105      OnContentChanged();
    104106      searchIterator = null;
    105     }   
     107    }
    106108
    107109    protected override void DeregisterContentEvents() {
     
    129131      if (!dataGridView.ReadOnly) {
    130132        string errorMessage;
    131         if (Content != null){
     133        if (Content != null) {
    132134          if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered()) {
    133135            errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode.";
     
    192194    }
    193195
    194     void DataGridView_SelectionChanged_FindAndReplace(object sender, EventArgs e) {
     196    private void DataGridView_SelectionChanged_FindAndReplace(object sender, EventArgs e) {
    195197      if (Content != null) {
    196198        if (!isSearching && AreMultipleCellsSelected()) {
     
    276278      isSearching = true;
    277279      SuspendRepaint();
    278       foreach (var column in FindAll(findAndReplaceDialog.GetSearchText())) {
     280      var selectedCells = FindAll(findAndReplaceDialog.GetSearchText());
     281      foreach (var column in selectedCells) {
    279282        foreach (var cell in column.Value) {
    280283          dataGridView[column.Key, cell].Selected = true;
     
    283286      ResumeRepaint(true);
    284287      isSearching = false;
    285       DataGridView_SelectionChanged(null, null);
     288      Content.DataGridLogic.SetSelection(selectedCells);
     289      //update statistic in base
     290      base.dataGridView_SelectionChanged(sender, e);
    286291    }
    287292
Note: See TracChangeset for help on using the changeset viewer.