Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs	(revision 10934)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs	(revision 10938)
@@ -36,4 +36,5 @@
     private bool notOwnEvent = true;
     private bool isSearching = false;
+    private bool isReplacing = false;
     private bool updateOnMouseUp = false;
     private SearchAndReplaceDialog findAndReplaceDialog;
@@ -80,5 +81,5 @@
     protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {
       if (Content != null) {
-        if (!isSearching) {
+        if (!isSearching && !isReplacing) {
 
           if (Control.MouseButtons == MouseButtons.Left) {
@@ -373,24 +374,26 @@
     private void Replace(IDictionary<int, IList<int>> cells) {
       if (findAndReplaceDialog != null) {
-        switch (findAndReplaceDialog.GetReplaceAction()) {
-          case ReplaceAction.Value:
-            Content.ManipulationLogic.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
-            break;
-          case ReplaceAction.Average:
-            Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
-            break;
-          case ReplaceAction.Median:
-            Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
-            break;
-          case ReplaceAction.Random:
-            Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
-            break;
-          case ReplaceAction.MostCommon:
-            Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
-            break;
-          case ReplaceAction.Interpolation:
-            Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
-            break;
-        }
+        ReplaceTransaction(() => {
+          switch (findAndReplaceDialog.GetReplaceAction()) {
+            case ReplaceAction.Value:
+              Content.ManipulationLogic.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
+              break;
+            case ReplaceAction.Average:
+              Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
+              break;
+            case ReplaceAction.Median:
+              Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
+              break;
+            case ReplaceAction.Random:
+              Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
+              break;
+            case ReplaceAction.MostCommon:
+              Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
+              break;
+            case ReplaceAction.Interpolation:
+              Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
+              break;
+          }
+        });
       }
     }
@@ -522,38 +525,74 @@
     }
 
+    private void StartReplacing() {
+      isReplacing = true;
+      SuspendRepaint();
+    }
+
+    private void StopReplacing() {
+      isReplacing = false;
+      ResumeRepaint(true); 
+    }
+
+    private void ReplaceTransaction(Action action) {
+      StartReplacing();
+      action();
+      StopReplacing();
+    }
+
     private void ReplaceWithAverage_Column_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), false);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), false);
+      });
     }
     private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), true);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), true);
+      });
     }
 
     private void ReplaceWithMedian_Column_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
+      });
     }
     private void ReplaceWithMedian_Selection_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
+      });
     }
 
     private void ReplaceWithRandom_Column_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
+      });
     }
     private void ReplaceWithRandom_Selection_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
+      });
     }
 
     private void ReplaceWithMostCommon_Column_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), false);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), false);
+      });
     }
     private void ReplaceWithMostCommon_Selection_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), true);
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), true);
+      });
     }
 
     private void ReplaceWithInterpolation_Column_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
+      });
     }
 
     private void ReplaceWithSmoothing_Selection_Click(object sender, EventArgs e) {
-      Content.ManipulationLogic.ReplaceIndicesBySmoothing(GetSelectedCells());
+      ReplaceTransaction(() => {
+        Content.ManipulationLogic.ReplaceIndicesBySmoothing(GetSelectedCells());
+      });
     }
 
