Index: /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.Designer.cs
===================================================================
--- /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.Designer.cs	(revision 17839)
+++ /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.Designer.cs	(revision 17840)
@@ -71,6 +71,6 @@
       // rowsTextBox
       // 
-      this.rowsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.rowsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.rowsTextBox.Location = new System.Drawing.Point(69, 0);
       this.rowsTextBox.Name = "rowsTextBox";
@@ -86,8 +86,8 @@
       this.dataGridView.AllowUserToDeleteRows = false;
       this.dataGridView.AllowUserToOrderColumns = true;
-      this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
+      this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
       this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
       this.dataGridView.Location = new System.Drawing.Point(0, 52);
@@ -115,6 +115,6 @@
       // columnsTextBox
       // 
-      this.columnsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.columnsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.columnsTextBox.Location = new System.Drawing.Point(69, 26);
       this.columnsTextBox.Name = "columnsTextBox";
@@ -136,4 +136,5 @@
       // contextMenu
       // 
+      this.contextMenu.ImageScalingSize = new System.Drawing.Size(20, 20);
       this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.ShowHideColumns});
@@ -150,6 +151,6 @@
       // statisticsTextBox
       // 
-      this.statisticsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.statisticsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.statisticsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
       this.statisticsTextBox.Location = new System.Drawing.Point(3, 388);
@@ -161,5 +162,4 @@
       // StringConvertibleMatrixView
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.columnsTextBox);
Index: /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
===================================================================
--- /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 17839)
+++ /trunk/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 17840)
@@ -306,61 +306,59 @@
     private void CopyValuesFromDataGridView() {
       if (dataGridView.SelectedCells.Count == 0) return;
+
+      //if not all cells are selected use the built-in functionality for copying values to the clipboard
+      if (!dataGridView.AreAllCellsSelected(false)) {
+        dataGridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
+        var data = dataGridView.GetClipboardContent();
+        Clipboard.SetDataObject(data);
+        return;
+      }
+
+      //Ff all cells are selected we want to include row and column headers if they are set in the content.
+      //This is not possible with the built-in functionality, because only both headers can be added.
+      //Furthermore, the current implementation of the view with the virtual datagridview does set 
+      //rowheaders only when they are displayed (see UpdateRowHeaders) and otherwise leaves them empty.
+
       StringBuilder s = new StringBuilder();
-      int minRowIndex = dataGridView.SelectedCells[0].RowIndex;
-      int maxRowIndex = dataGridView.SelectedCells[dataGridView.SelectedCells.Count - 1].RowIndex;
-      int minColIndex = dataGridView.SelectedCells[0].ColumnIndex;
-      int maxColIndex = dataGridView.SelectedCells[dataGridView.SelectedCells.Count - 1].ColumnIndex;
-
-      if (minRowIndex > maxRowIndex) {
-        int temp = minRowIndex;
-        minRowIndex = maxRowIndex;
-        maxRowIndex = temp;
-      }
-      if (minColIndex > maxColIndex) {
-        int temp = minColIndex;
-        minColIndex = maxColIndex;
-        maxColIndex = temp;
-      }
-
-      bool addRowNames = dataGridView.AreAllCellsSelected(false) && Content.RowNames.Count() > 0;
-      bool addColumnNames = dataGridView.AreAllCellsSelected(false) && Content.ColumnNames.Count() > 0;
-
-      //add colum names
+
+      bool addColumnNames = Content.ColumnNames.Any();
+      bool addRowNames = Content.RowNames.Any();
+
+      //add first row with column headers
       if (addColumnNames) {
-        if (addRowNames)
-          s.Append('\t');
-
+        var columnNames = Content.ColumnNames.ToArray();
+        if (addRowNames) s.Append('\t'); //there is no column header for the row headers
         DataGridViewColumn column = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
         while (column != null) {
-          s.Append(column.HeaderText);
+          s.Append(columnNames[column.Index]);
           s.Append('\t');
+
           column = dataGridView.Columns.GetNextColumn(column, DataGridViewElementStates.Visible, DataGridViewElementStates.None);
         }
+        s.Append(Environment.NewLine);
+      }
+
+      var rowNames = Content.RowNames.ToArray();
+      for (int r = 0; r < dataGridView.RowCount; r++) {
+        if (!dataGridView.Rows[r].Visible) continue; //skip invisible rows
+
+        int rowIndex = virtualRowIndices[r];
+        if (addRowNames) {
+          s.Append(rowNames[rowIndex]);
+          s.Append('\t');
+        }
+
+        DataGridViewColumn column = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
+        while (column != null) {
+          s.Append(Content.GetValue(rowIndex, column.Index));
+          s.Append('\t');
+
+          column = dataGridView.Columns.GetNextColumn(column, DataGridViewElementStates.Visible, DataGridViewElementStates.None);
+        }
+
         s.Remove(s.Length - 1, 1); //remove last tab
         s.Append(Environment.NewLine);
       }
 
-      for (int i = minRowIndex; i <= maxRowIndex; i++) {
-        if (!dataGridView.Rows[i].Visible) continue;
-
-        int rowIndex = this.virtualRowIndices[i];
-        if (addRowNames) {
-          s.Append(Content.RowNames.ElementAt(rowIndex));
-          s.Append('\t');
-        }
-
-        DataGridViewColumn column = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
-        while (column != null) {
-          DataGridViewCell cell = dataGridView[column.Index, i];
-          if (cell.Selected) {
-            s.Append(Content.GetValue(rowIndex, column.Index));
-            s.Append('\t');
-          }
-
-          column = dataGridView.Columns.GetNextColumn(column, DataGridViewElementStates.Visible, DataGridViewElementStates.None);
-        }
-        s.Remove(s.Length - 1, 1); //remove last tab
-        s.Append(Environment.NewLine);
-      }
       Clipboard.SetText(s.ToString());
     }
