Index: trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs	(revision 12599)
+++ trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs	(revision 12631)
@@ -24,5 +24,4 @@
 using System.ComponentModel;
 using System.Linq;
-using System.Windows.Forms;
 using HeuristicLab.Analysis;
 using HeuristicLab.Collections;
@@ -41,5 +40,5 @@
     }
 
-    private int rowNumber = 0;
+    private int rowNumber;
     private bool suppressUpdates;
     private readonly Dictionary<IRun, IEnumerable<DataRow>> runMapping;
@@ -60,38 +59,47 @@
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      Content.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
-      Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
-      Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
-      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
-      Content.OptimizerNameChanged += new EventHandler(Content_AlgorithmNameChanged);
+      Content.ItemsAdded += Content_ItemsAdded;
+      Content.ItemsRemoved += Content_ItemsRemoved;
+      Content.CollectionReset += Content_CollectionReset;
+      Content.UpdateOfRunsInProgressChanged += Content_UpdateOfRunsInProgressChanged;
+      Content.OptimizerNameChanged += Content_AlgorithmNameChanged;
     }
     protected override void DeregisterContentEvents() {
-      Content.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
-      Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
-      Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
-      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
-      Content.OptimizerNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
+      Content.ItemsAdded -= Content_ItemsAdded;
+      Content.ItemsRemoved -= Content_ItemsRemoved;
+      Content.CollectionReset -= Content_CollectionReset;
+      Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged;
+      Content.OptimizerNameChanged -= Content_AlgorithmNameChanged;
       base.DeregisterContentEvents();
     }
 
     private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      if (suppressUpdates) return;
       if (InvokeRequired) {
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e);
         return;
       }
+      UpdateDataTableComboBox();
+      UpdateDataRowComboBox();
       AddRuns(e.Items);
     }
     private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      if (suppressUpdates) return;
       if (InvokeRequired) {
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
         return;
       }
+      UpdateDataTableComboBox();
+      UpdateDataRowComboBox();
       RemoveRuns(e.Items);
     }
     private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      if (suppressUpdates) return;
       if (InvokeRequired) {
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
         return;
       }
+      UpdateDataTableComboBox();
+      UpdateDataRowComboBox();
       RemoveRuns(e.OldItems);
       AddRuns(e.Items);
@@ -108,5 +116,9 @@
       }
       suppressUpdates = Content.UpdateOfRunsInProgress;
-      if (!suppressUpdates) UpdateRuns(Content);
+      if (!suppressUpdates) {
+        UpdateDataTableComboBox();
+        UpdateDataRowComboBox();
+        UpdateRuns(Content);
+      }
     }
 
@@ -124,5 +136,5 @@
         var run = (IRun)sender;
         if (e.PropertyName == "Color" || e.PropertyName == "Visible")
-          UpdateRuns(new IRun[] { run });
+          UpdateRuns(new[] { run });
       }
     }
@@ -205,4 +217,6 @@
 
     private void UpdateDataTableComboBox() {
+      string selectedItem = (string)dataTableComboBox.SelectedItem;
+
       dataTableComboBox.Items.Clear();
       var dataTables = (from run in Content
@@ -212,5 +226,9 @@
 
       dataTableComboBox.Items.AddRange(dataTables);
-      if (dataTableComboBox.Items.Count > 0) dataTableComboBox.SelectedItem = dataTableComboBox.Items[0];
+      if (selectedItem != null && dataTableComboBox.Items.Contains(selectedItem)) {
+        dataTableComboBox.SelectedItem = selectedItem;
+      } else if (dataTableComboBox.Items.Count > 0) {
+        dataTableComboBox.SelectedItem = dataTableComboBox.Items[0];
+      }
     }
 
@@ -220,4 +238,6 @@
 
     private void UpdateDataRowComboBox() {
+      string selectedItem = (string)dataRowComboBox.SelectedItem;
+
       dataRowComboBox.Items.Clear();
       var resultName = (string)dataTableComboBox.SelectedItem;
@@ -231,11 +251,16 @@
       dataRowComboBox.Items.AddRange(rowNames);
       dataRowComboBox.Items.Add(AllDataRows);
-      if (dataRowComboBox.Items.Count > 0) dataRowComboBox.SelectedItem = dataRowComboBox.Items[0];
-    }
-
-    private void dataTableComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
-      UpdateDataRowComboBox();
-    }
-    private void dataRowComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
+      if (selectedItem != null && dataRowComboBox.Items.Contains(selectedItem)) {
+        dataRowComboBox.SelectedItem = selectedItem;
+      } else if (dataRowComboBox.Items.Count > 0) {
+        dataRowComboBox.SelectedItem = dataRowComboBox.Items[0];
+      }
+    }
+
+    private void dataTableComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      UpdateDataRowComboBox();
+    }
+    private void dataRowComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      if (suppressUpdates) return;
       RebuildCombinedDataTable();
     }
