Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs	(revision 14544)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs	(revision 14545)
@@ -57,5 +57,5 @@
         var viewShortcuts = new ItemList<IViewShortcut> {
           new DataGridContent(data, manipulationLogic, filterLogic),
-          new StatisticsContent(statisticsLogic),
+          new StatisticsContent(data, statisticsLogic),
 
           new LineChartContent(data),
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs	(revision 14544)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.Designer.cs	(revision 14545)
@@ -55,6 +55,5 @@
       this.lblNominalColumns = new System.Windows.Forms.Label();
       this.txtMissingValuesTotal = new System.Windows.Forms.Label();
-      this.dataGridView = new System.Windows.Forms.DataGridView();
-      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
+      this.stringMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
       this.SuspendLayout();
       // 
@@ -149,21 +148,18 @@
       this.txtMissingValuesTotal.Text = "102";
       // 
-      // dataGridView
-      // 
-      this.dataGridView.AllowUserToAddRows = false;
-      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)
+      // stringMatrixView
+      // 
+      this.stringMatrixView.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.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-      this.dataGridView.Location = new System.Drawing.Point(5, 117);
-      this.dataGridView.Name = "dataGridView";
-      this.dataGridView.ReadOnly = true;
-      this.dataGridView.RowHeadersWidth = 80;
-      this.dataGridView.Size = new System.Drawing.Size(530, 278);
-      this.dataGridView.TabIndex = 4;
-      this.dataGridView.VirtualMode = true;
-      this.dataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValueNeeded);
+      this.stringMatrixView.Caption = "StringConvertibleMatrix View";
+      this.stringMatrixView.Content = null;
+      this.stringMatrixView.Location = new System.Drawing.Point(5, 117);
+      this.stringMatrixView.Name = "stringMatrixView";
+      this.stringMatrixView.ReadOnly = true;
+      this.stringMatrixView.ShowRowsAndColumnsTextBox = false;
+      this.stringMatrixView.ShowStatisticalInformation = true;
+      this.stringMatrixView.Size = new System.Drawing.Size(530, 278);
+      this.stringMatrixView.TabIndex = 4;
       // 
       // StatisticsView
@@ -171,5 +167,5 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.dataGridView);
+      this.Controls.Add(this.stringMatrixView);
       this.Controls.Add(this.lblNominalColumns);
       this.Controls.Add(this.lblNumericColumns);
@@ -184,5 +180,4 @@
       this.Name = "StatisticsView";
       this.Size = new System.Drawing.Size(549, 408);
-      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -202,5 +197,5 @@
     private System.Windows.Forms.Label lblNominalColumns;
     private System.Windows.Forms.Label txtMissingValuesTotal;
-    private System.Windows.Forms.DataGridView dataGridView;
+    private HeuristicLab.Data.Views.StringConvertibleMatrixView stringMatrixView;
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs	(revision 14544)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs	(revision 14545)
@@ -24,4 +24,5 @@
 using System.Windows.Forms;
 using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
 using HeuristicLab.MainForm;
 
@@ -32,6 +33,20 @@
   public partial class StatisticsView : ItemView {
 
-    private List<List<string>> columnsRowsMatrix;
-    private readonly int COLUMNS = 12;
+    private StringMatrix statisticsMatrix;
+
+    private static readonly string[] RowNames = new[] {
+      "Type",
+      "Missing Values",
+      "Min",
+      "Max",
+      "Median",
+      "Average",
+      "std. Deviation",
+      "Variance",
+      "25th Percentile",
+      "75th Percentile",
+      "Most Common Value",
+      "Num. diff. Values"
+    };
 
     public new StatisticsContent Content {
@@ -52,5 +67,6 @@
         txtNominalColumns.Text = "";
         txtMissingValuesTotal.Text = "";
-        dataGridView.Columns.Clear();
+        stringMatrixView.Content = null;
+        statisticsMatrix = null;
       } else {
         UpdateData();
@@ -58,17 +74,12 @@
     }
 
-    /// <summary>
-    /// Adds eventhandlers to the current instance.
-    /// </summary>
     protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
       Content.Changed += Content_Changed;
     }
 
-
-    /// <summary>
-    /// Removes the eventhandlers from the current instance.
-    /// </summary>
     protected override void DeregisterContentEvents() {
       Content.Changed -= Content_Changed;
+      base.DeregisterContentEvents();
     }
 
@@ -76,49 +87,39 @@
       var logic = Content.StatisticsLogic;
       var rowCount = logic.GetRowCount();
-      txtRows.Text = rowCount.ToString();
-      txtColumns.Text = logic.GetColumnCount().ToString();
+      txtRows.Text = logic.GetColumnCount().ToString();
+      txtColumns.Text = rowCount.ToString();
       txtNumericColumns.Text = logic.GetNumericColumnCount().ToString();
       txtNominalColumns.Text = logic.GetNominalColumnCount().ToString();
       txtMissingValuesTotal.Text = logic.GetMissingValueCount().ToString();
 
-      columnsRowsMatrix = new List<List<string>>();
-      DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS];
-      for (int i = 0; i < COLUMNS; ++i) {
-        var column = new DataGridViewTextBoxColumn();
-        column.SortMode = DataGridViewColumnSortMode.Automatic;
-        column.FillWeight = 1;
-        columns[i] = column;
-      }
-
-      columns[0].HeaderCell.Value = "Type";
-      columns[1].HeaderCell.Value = "Missing Values";
-      columns[2].HeaderCell.Value = "Min";
-      columns[3].HeaderCell.Value = "Max";
-      columns[4].HeaderCell.Value = "Median";
-      columns[5].HeaderCell.Value = "Average";
-      columns[6].HeaderCell.Value = "std. Deviation";
-      columns[7].HeaderCell.Value = "Variance";
-      columns[8].HeaderCell.Value = "25th Percentile";
-      columns[9].HeaderCell.Value = "75th Percentile";
-      columns[10].HeaderCell.Value = "Most Common Value";
-      columns[11].HeaderCell.Value = "Num. diff. Values";
+      statisticsMatrix = new StringMatrix(RowNames.Length, Content.PreprocessingData.Columns) {
+        RowNames = StatisticsView.RowNames,
+        ColumnNames = Content.PreprocessingData.VariableNames
+      };
 
       if (rowCount > 0) {
         for (int i = 0; i < logic.GetColumnCount(); ++i) {
-          columnsRowsMatrix.Add(GetList(i));
+          var data = GetList(i);
+          for (int j = 0; j < data.Count; j++) {
+            statisticsMatrix[j, i] = data[j];
+          }
         }
       }
-
-      dataGridView.Columns.Clear();
-      dataGridView.Columns.AddRange(columns);
-      dataGridView.RowCount = columnsRowsMatrix.Count;
-
-      for (int i = 0; i < columnsRowsMatrix.Count; ++i) {
-        dataGridView.Rows[i].HeaderCell.Value = logic.GetVariableName(i);
-      }
-
-      dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
-      dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
-      dataGridView.AllowUserToResizeColumns = true;
+      stringMatrixView.Content = statisticsMatrix;
+
+      foreach (DataGridViewColumn column in stringMatrixView.DataGridView.Columns) {
+        var variable = column.HeaderText;
+        bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
+                             || Content.PreprocessingData.TargetVariable == variable;
+        column.Visible = isInputTarget;
+      }
+      stringMatrixView.DataGridView.AutoResizeColumns();
+
+      //foreach (DataGridViewRow row in stringMatrixView.DataGridView.Rows) {
+      //  var variable = (string)row.HeaderCell.Value;
+      //  bool isInputTarget = Content.PreprocessingData.InputVariables.Contains(variable)
+      //                       || Content.PreprocessingData.TargetVariable == variable;
+      //  row.Visible = isInputTarget;
+      //}
     }
 
@@ -134,5 +135,5 @@
       } else {
         list = new List<string>();
-        for (int j = 0; j < COLUMNS; ++j) {
+        for (int j = 0; j < RowNames.Length; ++j) {
           list.Add("unknown column type");
         }
@@ -195,31 +196,25 @@
     }
 
-    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
-      if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < columnsRowsMatrix[0].Count) {
-        e.Value = columnsRowsMatrix[e.RowIndex][e.ColumnIndex];
-      }
-    }
-
     private void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
-      switch (e.Type) {
-        case DataPreprocessingChangedEventType.DeleteColumn:
-          columnsRowsMatrix.RemoveAt(e.Column);
-          break;
-        case DataPreprocessingChangedEventType.AddColumn:
-          columnsRowsMatrix.Insert(e.Row, GetList(e.Column));
-          dataGridView.RowCount++;
-          break;
-        case DataPreprocessingChangedEventType.ChangeItem:
-          columnsRowsMatrix[e.Column] = GetList(e.Column);
-          break;
-        case DataPreprocessingChangedEventType.DeleteRow:
-        case DataPreprocessingChangedEventType.AddRow:
-        default:
-          for (int i = 0; i < columnsRowsMatrix.Count; ++i) {
-            columnsRowsMatrix[i] = GetList(e.Column);
-          }
-          break;
-      }
-      dataGridView.Refresh();
+      UpdateData();
+      //switch (e.Type) {
+      //  case DataPreprocessingChangedEventType.DeleteColumn:
+      //    statisticsMatrix.RemoveAt(e.Column);
+      //    break;
+      //  case DataPreprocessingChangedEventType.AddColumn:
+      //    statisticsMatrix.Insert(e.Row, GetList(e.Column));
+      //    stringMatrixView.Content.Rows++;
+      //    break;
+      //  case DataPreprocessingChangedEventType.ChangeItem:
+      //    statisticsMatrix[e.Column] = GetList(e.Column);
+      //    break;
+      //  case DataPreprocessingChangedEventType.DeleteRow:
+      //  case DataPreprocessingChangedEventType.AddRow:
+      //  default:
+      //    for (int i = 0; i < statisticsMatrix.Count; ++i) {
+      //      statisticsMatrix[i] = GetList(e.Column);
+      //    }
+      //    break;
+      //}
     }
   }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/StatisticsContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/StatisticsContent.cs	(revision 14544)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/StatisticsContent.cs	(revision 14545)
@@ -27,7 +27,9 @@
   [Item("Statistics", "Represents the statistics grid.")]
   public class StatisticsContent : Item, IViewShortcut {
+    public ITransactionalPreprocessingData PreprocessingData { get; private set; }
 
     private readonly StatisticsLogic statisticsLogic;
-    public StatisticsContent(StatisticsLogic theStatisticsLogic) {
+    public StatisticsContent(ITransactionalPreprocessingData preProcessingData, StatisticsLogic theStatisticsLogic) {
+      PreprocessingData = preProcessingData;
       statisticsLogic = theStatisticsLogic;
     }
