private void CreateFindAndReplaceDialog() { if (findAndReplaceDialog == null || findAndReplaceDialog.IsDisposed) { findAndReplaceDialog = new SearchAndReplaceDialog(); findAndReplaceDialog.Show(this); if (AreMultipleCellsSelected()) { ResetHighlightedCellsBackground(); HightlightedCellsBackground = GetSelectedCells(); dataGridView.ClearSelection(); } findAndReplaceDialog.FindAllEvent += findAndReplaceDialog_FindAllEvent; findAndReplaceDialog.FindNextEvent += findAndReplaceDialog_FindNextEvent; findAndReplaceDialog.ReplaceAllEvent += findAndReplaceDialog_ReplaceAllEvent; findAndReplaceDialog.ReplaceNextEvent += findAndReplaceDialog_ReplaceEvent; findAndReplaceDialog.FormClosing += findAndReplaceDialog_FormClosing; searchIterator = null; DataGridView.SelectionChanged += DataGridView_SelectionChanged_FindAndReplace; if (Content.FilterLogic.IsFiltered) { findAndReplaceDialog.DisableReplace(); } } }
private void FilterLogic_FilterChanged(object sender, EventArgs e) { OnContentChanged(); searchIterator = null; if (findAndReplaceDialog != null && !findAndReplaceDialog.IsDisposed) { if (Content.PreprocessingData.IsFiltered) { findAndReplaceDialog.DisableReplace(); } else { findAndReplaceDialog.EnableReplace(); } } btnReplace.Enabled = !Content.PreprocessingData.IsFiltered; }