Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs	(revision 6516)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs	(revision 6517)
@@ -34,4 +34,5 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExperimentTreeView));
       this.optimizersGroupBox = new System.Windows.Forms.GroupBox();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
@@ -41,8 +42,11 @@
       this.moveDownButton = new System.Windows.Forms.Button();
       this.addButton = new System.Windows.Forms.Button();
-      this.optimizerTreeView = new System.Windows.Forms.TreeView();
+      this.optimizerTreeView = new HeuristicLab.Optimization.Views.ExperimentTreeView.CustomTreeView();
       this.imageList = new System.Windows.Forms.ImageList(this.components);
       this.detailsGroupBox = new System.Windows.Forms.GroupBox();
       this.detailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+      this.ExpandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.CollapseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
       this.optimizersGroupBox.SuspendLayout();
@@ -52,4 +56,5 @@
       this.splitContainer.SuspendLayout();
       this.detailsGroupBox.SuspendLayout();
+      this.contextMenuStrip.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -163,4 +168,6 @@
       this.optimizerTreeView.TabIndex = 10;
       this.optimizerTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.optimizerTreeView_ItemDrag);
+      this.optimizerTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.optimizerTreeview_NodeMouseClick);
+      this.optimizerTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.optimizerTreeView_NodeMouseDoubleClick);
       this.optimizerTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.optimizerTreeView_DragDrop);
       this.optimizerTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.optimizerTreeView_DragEnter);
@@ -168,6 +175,5 @@
       this.optimizerTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.optimizerTreeView_KeyDown);
       this.optimizerTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.optimizerTreeView_MouseDown);
-      this.optimizerTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.optimizerTreeview_NodeMouseClick);
-      this.optimizerTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(optimizerTreeView_NodeMouseDoubleClick);
+      this.optimizerTreeView.RightClick += new System.EventHandler(optimizerTreeView_RightClick);
       // 
       // imageList
@@ -206,4 +212,26 @@
       this.detailsViewHost.ViewType = null;
       // 
+      // contextMenuStrip
+      // 
+      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.ExpandToolStripMenuItem,
+            this.CollapseToolStripMenuItem});
+      this.contextMenuStrip.Name = "contextMenuStrip";
+      this.contextMenuStrip.Size = new System.Drawing.Size(120, 48);
+      // 
+      // ExpandToolStripMenuItem
+      // 
+      this.ExpandToolStripMenuItem.Name = "ExpandToolStripMenuItem";
+      this.ExpandToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
+      this.ExpandToolStripMenuItem.Text = "Expand";
+      this.ExpandToolStripMenuItem.Click += new System.EventHandler(this.ExpandToolStripMenuItem_Click);
+      // 
+      // CollapseToolStripMenuItem
+      // 
+      this.CollapseToolStripMenuItem.Name = "CollapseToolStripMenuItem";
+      this.CollapseToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
+      this.CollapseToolStripMenuItem.Text = "Collapse";
+      this.CollapseToolStripMenuItem.Click += new System.EventHandler(this.CollapseToolStripMenuItem_Click);
+      // 
       // ExperimentTreeView
       // 
@@ -219,4 +247,5 @@
       this.splitContainer.ResumeLayout(false);
       this.detailsGroupBox.ResumeLayout(false);
+      this.contextMenuStrip.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -226,5 +255,5 @@
     private System.Windows.Forms.GroupBox optimizersGroupBox;
     private System.Windows.Forms.SplitContainer splitContainer;
-    private System.Windows.Forms.TreeView optimizerTreeView;
+    private HeuristicLab.Optimization.Views.ExperimentTreeView.CustomTreeView optimizerTreeView;
     private System.Windows.Forms.GroupBox detailsGroupBox;
     private MainForm.WindowsForms.ViewHost detailsViewHost;
@@ -236,4 +265,7 @@
     private System.Windows.Forms.Button addButton;
     private System.Windows.Forms.ImageList imageList;
+    private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
+    private System.Windows.Forms.ToolStripMenuItem ExpandToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem CollapseToolStripMenuItem;
 
   }
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs	(revision 6516)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs	(revision 6517)
@@ -498,6 +498,7 @@
     #region control events
     private void optimizerTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
+      if (rightClickOccured) return;
       if (e.X < e.Node.Bounds.Left || e.X > e.Node.Bounds.Right) return;
-      optimizerTreeView.SelectedNode.Toggle();
+      e.Node.Toggle();
       IOptimizer optimizer = (IOptimizer)e.Node.Tag;
       MainFormManager.MainForm.ShowContent(optimizer);
@@ -511,5 +512,5 @@
     private void optimizerTreeView_MouseDown(object sender, MouseEventArgs e) {
       // enables deselection of treeNodes
-      if (e.Button != System.Windows.Forms.MouseButtons.Left) return;
+      if (e.Button != MouseButtons.Right) rightClickOccured = false;
       if (optimizerTreeView.SelectedNode == null) return;
       Point coordinates = new Point(e.X, e.Y);
@@ -522,4 +523,5 @@
     }
 
+
     private void optimizerTreeView_KeyDown(object sender, KeyEventArgs e) {
       if (ReadOnly) return;
@@ -542,4 +544,32 @@
       UpdateDetailsViewHost();
       RebuildImageList();
+    }
+
+    private bool rightClickOccured = true;
+    private TreeNode toolStripMenuNode = null;
+    private void optimizerTreeView_RightClick(object sender, EventArgs e) {
+      rightClickOccured = true;
+      Point coordinates = optimizerTreeView.PointToClient(Cursor.Position);
+      toolStripMenuNode = optimizerTreeView.GetNodeAt(coordinates);
+
+      if (toolStripMenuNode != null && coordinates.X >= toolStripMenuNode.Bounds.Left && coordinates.X <= toolStripMenuNode.Bounds.Right) {
+        optimizerTreeView.SelectedNode = toolStripMenuNode;
+        detailsViewHost.Content = (IContent)toolStripMenuNode.Tag;
+        SetEnabledStateOfControls();
+
+        ExpandToolStripMenuItem.Enabled = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0;
+        ExpandToolStripMenuItem.Visible = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0;
+        CollapseToolStripMenuItem.Enabled = toolStripMenuNode.IsExpanded;
+        CollapseToolStripMenuItem.Visible = toolStripMenuNode.IsExpanded;
+        if (contextMenuStrip.Items.Cast<ToolStripMenuItem>().Any(item => item.Enabled))
+          contextMenuStrip.Show(Cursor.Position);
+      }
+    }
+
+    private void ExpandToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (toolStripMenuNode != null) toolStripMenuNode.ExpandAll();
+    }
+    private void CollapseToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (toolStripMenuNode != null) toolStripMenuNode.Collapse();
     }
 
@@ -689,4 +719,23 @@
     }
     #endregion
+
+
+    public sealed class CustomTreeView : System.Windows.Forms.TreeView {
+      protected override void WndProc(ref System.Windows.Forms.Message m) {
+        const int WM_RBUTTONDOWN = 0x204;
+        if (m.Msg == WM_RBUTTONDOWN) {
+          //Raise your custom event right click event to prevent node highlighting
+          OnRightClick();
+          return;
+        }
+        base.WndProc(ref m);
+      }
+
+      public event EventHandler RightClick;
+      private void OnRightClick() {
+        var handler = RightClick;
+        if (handler != null) RightClick(this, EventArgs.Empty);
+      }
+    }
   }
 }
