Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/04/14 10:51:34 (10 years ago)
Author:
rstoll
Message:
  • Disabled Replace tab in SearchAndReplaceDialog if a filter is active
  • Disabled Replace button in DataGridview if filter is active
  • Refactored/Changed IFilterLogic#IsFiltered from method to property
File:
1 edited

Legend:

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

    r10916 r10930  
    102102    }
    103103
    104     void FilterLogic_FilterChanged(object sender, EventArgs e) {
    105       OnContentChanged();
    106       searchIterator = null;
    107     }
    108 
    109104    protected override void DeregisterContentEvents() {
    110105      base.DeregisterContentEvents();
    111106      Content.Changed -= Content_Changed;
    112107      Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged;
     108    }
     109
     110    void FilterLogic_FilterChanged(object sender, EventArgs e) {
     111      OnContentChanged();
     112      searchIterator = null;
     113      if (findAndReplaceDialog != null && !findAndReplaceDialog.IsDisposed) {
     114        if (Content.FilterLogic.IsFiltered) {
     115          findAndReplaceDialog.DisableReplace();
     116        } else {
     117          findAndReplaceDialog.EnableReplace();
     118        }
     119      }
     120      btnReplace.Enabled = !Content.FilterLogic.IsFiltered;
    113121    }
    114122
     
    132140        string errorMessage;
    133141        if (Content != null) {
    134           if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered()) {
     142          if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered) {
    135143            errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode.";
    136144          } else {
     
    191199        searchIterator = null;
    192200        DataGridView.SelectionChanged += DataGridView_SelectionChanged_FindAndReplace;
     201        if (Content.FilterLogic.IsFiltered) {
     202          findAndReplaceDialog.DisableReplace();
     203        }
    193204      }
    194205    }
Note: See TracChangeset for help on using the changeset viewer.