Index: branches/DataPreprocessing/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 10999)
+++ branches/DataPreprocessing/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs	(revision 11000)
@@ -36,5 +36,5 @@
   public partial class StringConvertibleMatrixView : AsynchronousContentView {
     protected int[] virtualRowIndices;
-    private List<KeyValuePair<int, SortOrder>> sortedColumnIndices;
+    protected List<KeyValuePair<int, SortOrder>> sortedColumnIndices;
     private RowComparer rowComparer;
 
@@ -261,5 +261,5 @@
 
     #region DataGridView Events
-    private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
+    protected virtual void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
       if (!dataGridView.ReadOnly) {
         string errorMessage;
@@ -270,5 +270,5 @@
       }
     }
-    private void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) {
+    protected virtual void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) {
       if (!dataGridView.ReadOnly) {
         string value = e.Value.ToString();
@@ -364,5 +364,5 @@
     }
 
-    private void PasteValuesToDataGridView() {
+    protected virtual void PasteValuesToDataGridView() {
       string[,] values = SplitClipboardString(Clipboard.GetText());
       int rowIndex = 0;
@@ -432,5 +432,5 @@
     }
 
-    private void Sort() {
+    protected void Sort() {
       virtualRowIndices = Sort(sortedColumnIndices);
       UpdateSortGlyph();
@@ -542,5 +542,5 @@
     }
 
-    private void dataGridView_SelectionChanged(object sender, EventArgs e) {
+    protected virtual void dataGridView_SelectionChanged(object sender, EventArgs e) {
       string stringFormat = "{0,20:0.0000}";
       statisticsTextBox.Text = string.Empty;
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs	(revision 10999)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs	(revision 11000)
@@ -26,4 +26,5 @@
 using System.Windows.Forms;
 using HeuristicLab.Data;
+using HeuristicLab.Data.Views;
 using HeuristicLab.DataPreprocessing.Filter;
 using HeuristicLab.MainForm;
@@ -32,5 +33,5 @@
   [View("Data Grid Content View")]
   [Content(typeof(IDataGridContent), true)]
-  public partial class DataGridContentView : PreprocessingStringConvertibleMatrixView {
+  public partial class DataGridContentView : StringConvertibleMatrixView {
 
     private bool notOwnEvent = true;
@@ -137,6 +138,4 @@
     }
 
-    #region methods which override/modify methods from PreprocessingStringConvertibleMatrixView
-
     protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {
       base.dataGridView_SelectionChanged(sender, e);
@@ -186,6 +185,4 @@
       base.ClearSorting();
     }
-
-    #endregion
 
     private void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj	(revision 10999)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj	(revision 11000)
@@ -185,10 +185,4 @@
       <DependentUpon>StatisticsView.cs</DependentUpon>
     </Compile>
-    <Compile Include="PreprocessingStringConvertibleMatrixView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="PreprocessingStringConvertibleMatrixView.Designer.cs">
-      <DependentUpon>PreprocessingStringConvertibleMatrixView.cs</DependentUpon>
-    </Compile>
     <Compile Include="TransformationView.cs">
       <SubType>UserControl</SubType>
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingStringConvertibleMatrixView.Designer.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingStringConvertibleMatrixView.Designer.cs	(revision 10999)
+++ 	(revision )
@@ -1,193 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-namespace HeuristicLab.DataPreprocessing.Views {
-  partial class PreprocessingStringConvertibleMatrixView {
-    /// <summary> 
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Component Designer generated code
-
-    /// <summary> 
-    /// Required method for Designer support - do not modify 
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.components = new System.ComponentModel.Container();
-      this.rowsLabel = new System.Windows.Forms.Label();
-      this.rowsTextBox = new System.Windows.Forms.TextBox();
-      this.dataGridView = new System.Windows.Forms.DataGridView();
-      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
-      this.columnsTextBox = new System.Windows.Forms.TextBox();
-      this.columnsLabel = new System.Windows.Forms.Label();
-      this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
-      this.ShowHideColumns = new System.Windows.Forms.ToolStripMenuItem();
-      this.statisticsTextBox = new System.Windows.Forms.TextBox();
-      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
-      this.contextMenu.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // rowsLabel
-      // 
-      this.rowsLabel.AutoSize = true;
-      this.rowsLabel.Location = new System.Drawing.Point(3, 3);
-      this.rowsLabel.Name = "rowsLabel";
-      this.rowsLabel.Size = new System.Drawing.Size(37, 13);
-      this.rowsLabel.TabIndex = 0;
-      this.rowsLabel.Text = "&Rows:";
-      // 
-      // 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.Location = new System.Drawing.Point(69, 0);
-      this.rowsTextBox.Name = "rowsTextBox";
-      this.rowsTextBox.Size = new System.Drawing.Size(355, 20);
-      this.rowsTextBox.TabIndex = 1;
-      this.rowsTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rowsTextBox_KeyDown);
-      this.rowsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.rowsTextBox_Validating);
-      this.rowsTextBox.Validated += new System.EventHandler(this.rowsTextBox_Validated);
-      // 
-      // 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)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
-      this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
-      this.dataGridView.Location = new System.Drawing.Point(0, 52);
-      this.dataGridView.Name = "dataGridView";
-      this.dataGridView.RowHeadersWidth = 160;
-      this.dataGridView.Size = new System.Drawing.Size(424, 330);
-      this.dataGridView.TabIndex = 4;
-      this.dataGridView.VirtualMode = true;
-      this.dataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellEndEdit);
-      this.dataGridView.CellParsing += new System.Windows.Forms.DataGridViewCellParsingEventHandler(this.dataGridView_CellParsing);
-      this.dataGridView.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView_CellValidating);
-      this.dataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValueNeeded);
-      this.dataGridView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_ColumnHeaderMouseClick);
-      this.dataGridView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dataGridView_Scroll);
-      this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged);
-      this.dataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView_KeyDown);
-      this.dataGridView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridView_MouseClick);
-      this.dataGridView.Resize += new System.EventHandler(this.dataGridView_Resize);
-      // 
-      // errorProvider
-      // 
-      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
-      this.errorProvider.ContainerControl = this;
-      // 
-      // 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.Location = new System.Drawing.Point(69, 26);
-      this.columnsTextBox.Name = "columnsTextBox";
-      this.columnsTextBox.Size = new System.Drawing.Size(355, 20);
-      this.columnsTextBox.TabIndex = 3;
-      this.columnsTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.columnsTextBox_KeyDown);
-      this.columnsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.columnsTextBox_Validating);
-      this.columnsTextBox.Validated += new System.EventHandler(this.columnsTextBox_Validated);
-      // 
-      // columnsLabel
-      // 
-      this.columnsLabel.AutoSize = true;
-      this.columnsLabel.Location = new System.Drawing.Point(3, 29);
-      this.columnsLabel.Name = "columnsLabel";
-      this.columnsLabel.Size = new System.Drawing.Size(50, 13);
-      this.columnsLabel.TabIndex = 2;
-      this.columnsLabel.Text = "&Columns:";
-      // 
-      // contextMenu
-      // 
-      this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.ShowHideColumns});
-      this.contextMenu.Name = "contextMenu";
-      this.contextMenu.Size = new System.Drawing.Size(191, 26);
-      // 
-      // ShowHideColumns
-      // 
-      this.ShowHideColumns.Name = "ShowHideColumns";
-      this.ShowHideColumns.Size = new System.Drawing.Size(190, 22);
-      this.ShowHideColumns.Text = "Show / Hide Columns";
-      this.ShowHideColumns.Click += new System.EventHandler(this.ShowHideColumns_Click);
-      // 
-      // 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.BorderStyle = System.Windows.Forms.BorderStyle.None;
-      this.statisticsTextBox.Location = new System.Drawing.Point(3, 388);
-      this.statisticsTextBox.Name = "statisticsTextBox";
-      this.statisticsTextBox.Size = new System.Drawing.Size(418, 13);
-      this.statisticsTextBox.TabIndex = 5;
-      this.statisticsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-      // 
-      // StringConvertibleMatrixView
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.Controls.Add(this.columnsTextBox);
-      this.Controls.Add(this.dataGridView);
-      this.Controls.Add(this.rowsTextBox);
-      this.Controls.Add(this.columnsLabel);
-      this.Controls.Add(this.rowsLabel);
-      this.Controls.Add(this.statisticsTextBox);
-      this.Name = "StringConvertibleMatrixView";
-      this.Size = new System.Drawing.Size(424, 404);
-      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
-      this.contextMenu.ResumeLayout(false);
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-    #endregion
-
-    protected System.Windows.Forms.Label rowsLabel;
-    protected System.Windows.Forms.TextBox rowsTextBox;
-    protected System.Windows.Forms.ErrorProvider errorProvider;
-    protected System.Windows.Forms.TextBox columnsTextBox;
-    protected System.Windows.Forms.Label columnsLabel;
-    protected System.Windows.Forms.ContextMenuStrip contextMenu;
-    protected System.Windows.Forms.ToolStripMenuItem ShowHideColumns;
-    protected System.Windows.Forms.DataGridView dataGridView;
-    protected System.Windows.Forms.TextBox statisticsTextBox;
-
-  }
-}
Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingStringConvertibleMatrixView.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingStringConvertibleMatrixView.cs	(revision 10999)
+++ 	(revision )
@@ -1,605 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using HeuristicLab.Common;
-using HeuristicLab.Data;
-using HeuristicLab.Data.Views;
-using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
-
-namespace HeuristicLab.DataPreprocessing.Views {
-  [View("StringConvertibleMatrix View")]
-  [Content(typeof(IStringConvertibleMatrix), false)]
-  public partial class PreprocessingStringConvertibleMatrixView : AsynchronousContentView {
-
-    // Was private before
-    protected virtual void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
-      if (!dataGridView.ReadOnly) {
-        string errorMessage;
-        if (Content != null && !Content.Validate(e.FormattedValue.ToString(), out errorMessage)) {
-          e.Cancel = true;
-          dataGridView.Rows[e.RowIndex].ErrorText = errorMessage;
-        }
-      }
-    }
-
-    // Was private before
-    protected virtual void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) {
-      if (!dataGridView.ReadOnly) {
-        string value = e.Value.ToString();
-        int rowIndex = virtualRowIndices[e.RowIndex];
-        e.ParsingApplied = Content.SetValue(value, rowIndex, e.ColumnIndex);
-        if (e.ParsingApplied) e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
-      }
-    }
-
-    // Was private before
-    protected virtual void PasteValuesToDataGridView() {
-      string[,] values = SplitClipboardString(Clipboard.GetText());
-      int rowIndex = 0;
-      int columnIndex = 0;
-      if (dataGridView.CurrentCell != null) {
-        rowIndex = dataGridView.CurrentCell.RowIndex;
-        columnIndex = dataGridView.CurrentCell.ColumnIndex;
-      }
-      if (Content.Rows < values.GetLength(1) + rowIndex) Content.Rows = values.GetLength(1) + rowIndex;
-      if (Content.Columns < values.GetLength(0) + columnIndex) Content.Columns = values.GetLength(0) + columnIndex;
-
-      for (int row = 0; row < values.GetLength(1); row++) {
-        for (int col = 0; col < values.GetLength(0); col++) {
-          Content.SetValue(values[col, row], row + rowIndex, col + columnIndex);
-        }
-      }
-      ClearSorting();
-    }
-
-    // Was private before
-    protected virtual void dataGridView_SelectionChanged(object sender, EventArgs e) {
-      string stringFormat = "{0,20:0.0000}";
-      statisticsTextBox.Text = string.Empty;
-      if (dataGridView.SelectedCells.Count > 1) {
-        List<double> selectedValues = new List<double>();
-        foreach (DataGridViewCell cell in dataGridView.SelectedCells) {
-          double value;
-          if (!double.TryParse(cell.Value.ToString(), out value)) return;
-          selectedValues.Add(value);
-        }
-        if (selectedValues.Count > 1) {
-          StringBuilder labelText = new StringBuilder();
-          labelText.Append("Count: " + string.Format(stringFormat, selectedValues.Count) + "    ");
-          labelText.Append("Sum: " + string.Format(stringFormat, selectedValues.Sum()) + "    ");
-          labelText.Append("Min: " + string.Format(stringFormat, selectedValues.Min()) + "    ");
-          labelText.Append("Max: " + string.Format(stringFormat, selectedValues.Max()) + "    ");
-          labelText.Append("Average: " + string.Format(stringFormat, selectedValues.Average()) + "    ");
-          labelText.Append("Standard Deviation: " + string.Format(stringFormat, selectedValues.StandardDeviation()) + "    ");
-
-          statisticsTextBox.Text = labelText.ToString();
-        }
-      }
-    }
-
-    // Was private before
-    protected void Sort() {
-      virtualRowIndices = Sort(sortedColumnIndices);
-      UpdateSortGlyph();
-      UpdateRowHeaders();
-      dataGridView.Invalidate();
-    }
-
-    // Was private before
-    protected List<KeyValuePair<int, SortOrder>> sortedColumnIndices;
-
-    #region unchanged copied from original - see  HeuristicLab.Data.Views.StringConvertibleMatrix
-
-    protected int[] virtualRowIndices;
-    private RowComparer rowComparer;
-
-    public new IStringConvertibleMatrix Content {
-      get { return (IStringConvertibleMatrix)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public DataGridView DataGridView {
-      get { return dataGridView; }
-    }
-
-    public override bool ReadOnly {
-      get {
-        if ((Content != null) && Content.ReadOnly) return true;
-        return base.ReadOnly;
-      }
-      set { base.ReadOnly = value; }
-    }
-
-    private bool showRowsAndColumnsTextBox;
-    public bool ShowRowsAndColumnsTextBox {
-      get { return showRowsAndColumnsTextBox; }
-      set {
-        showRowsAndColumnsTextBox = value;
-        UpdateVisibilityOfTextBoxes();
-      }
-    }
-
-    private bool showStatisticalInformation;
-    public bool ShowStatisticalInformation {
-      get { return showStatisticalInformation; }
-      set {
-        showStatisticalInformation = value;
-        UpdateVisibilityOfStatisticalInformation();
-      }
-    }
-
-    public PreprocessingStringConvertibleMatrixView() {
-      InitializeComponent();
-      ShowRowsAndColumnsTextBox = true;
-      ShowStatisticalInformation = true;
-      errorProvider.SetIconAlignment(rowsTextBox, ErrorIconAlignment.MiddleLeft);
-      errorProvider.SetIconPadding(rowsTextBox, 2);
-      errorProvider.SetIconAlignment(columnsTextBox, ErrorIconAlignment.MiddleLeft);
-      errorProvider.SetIconPadding(columnsTextBox, 2);
-      sortedColumnIndices = new List<KeyValuePair<int, SortOrder>>();
-      rowComparer = new RowComparer();
-    }
-
-    protected override void DeregisterContentEvents() {
-      Content.ItemChanged -= new EventHandler<EventArgs<int, int>>(Content_ItemChanged);
-      Content.Reset -= new EventHandler(Content_Reset);
-      Content.ColumnNamesChanged -= new EventHandler(Content_ColumnNamesChanged);
-      Content.RowNamesChanged -= new EventHandler(Content_RowNamesChanged);
-      base.DeregisterContentEvents();
-    }
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ItemChanged += new EventHandler<EventArgs<int, int>>(Content_ItemChanged);
-      Content.Reset += new EventHandler(Content_Reset);
-      Content.ColumnNamesChanged += new EventHandler(Content_ColumnNamesChanged);
-      Content.RowNamesChanged += new EventHandler(Content_RowNamesChanged);
-    }
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      if (Content == null) {
-        rowsTextBox.Text = "";
-        columnsTextBox.Text = "";
-        dataGridView.Rows.Clear();
-        dataGridView.Columns.Clear();
-        virtualRowIndices = new int[0];
-      } else
-        UpdateData();
-    }
-
-    protected override void SetEnabledStateOfControls() {
-      base.SetEnabledStateOfControls();
-      rowsTextBox.Enabled = Content != null;
-      columnsTextBox.Enabled = Content != null;
-      dataGridView.Enabled = Content != null;
-      rowsTextBox.ReadOnly = ReadOnly;
-      columnsTextBox.ReadOnly = ReadOnly;
-      dataGridView.ReadOnly = ReadOnly;
-    }
-
-    private void UpdateData() {
-
-      Point[] selectedCellsBeforeUpdate = GetSelectedCellsAsPoints();
-
-      rowsTextBox.Text = Content.Rows.ToString();
-      rowsTextBox.Enabled = true;
-      columnsTextBox.Text = Content.Columns.ToString();
-      columnsTextBox.Enabled = true;
-      virtualRowIndices = Enumerable.Range(0, Content.Rows).ToArray();
-
-      if (Content.Columns == 0 && dataGridView.ColumnCount != Content.Columns && !Content.ReadOnly)
-        Content.Columns = dataGridView.ColumnCount;
-      else {
-        DataGridViewColumn[] columns = new DataGridViewColumn[Content.Columns];
-        for (int i = 0; i < columns.Length; ++i) {
-          var column = new DataGridViewTextBoxColumn();
-          column.FillWeight = 1;
-          columns[i] = column;
-        }
-        dataGridView.Columns.Clear();
-        dataGridView.Columns.AddRange(columns);
-      }
-
-      //DataGridViews with rows but no columns are not allowed !
-      if (Content.Rows == 0 && dataGridView.RowCount != Content.Rows && !Content.ReadOnly)
-        Content.Rows = dataGridView.RowCount;
-      else
-        dataGridView.RowCount = Content.Rows;
-
-      ClearSorting();
-      UpdateColumnHeaders();
-      UpdateRowHeaders();
-
-      dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
-      dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
-      dataGridView.Enabled = true;
-
-
-      dataGridView.CurrentCell = null;
-      foreach (Point p in selectedCellsBeforeUpdate)
-        dataGridView[p.X, p.Y].Selected = true;
-    }
-
-    protected virtual void UpdateColumnHeaders() {
-      HashSet<string> invisibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>()
-      .Where(c => !c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText));
-
-      for (int i = 0; i < dataGridView.ColumnCount; i++) {
-        if (i < Content.ColumnNames.Count())
-          dataGridView.Columns[i].HeaderText = Content.ColumnNames.ElementAt(i);
-        else
-          dataGridView.Columns[i].HeaderText = "Column " + (i + 1);
-        dataGridView.Columns[i].Visible = !invisibleColumnNames.Contains(dataGridView.Columns[i].HeaderText);
-      }
-    }
-    protected virtual void UpdateRowHeaders() {
-      int index = dataGridView.FirstDisplayedScrollingRowIndex;
-      if (index == -1) index = 0;
-      int updatedRows = 0;
-      int count = dataGridView.DisplayedRowCount(true);
-
-      while (updatedRows < count) {
-        if (virtualRowIndices[index] < Content.RowNames.Count())
-          dataGridView.Rows[index].HeaderCell.Value = Content.RowNames.ElementAt(virtualRowIndices[index]);
-        else
-          dataGridView.Rows[index].HeaderCell.Value = "Row " + (index + 1);
-        if (dataGridView.Rows[index].Visible)
-          updatedRows++;
-        index++;
-      }
-    }
-
-    private void Content_RowNamesChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Content_RowNamesChanged), sender, e);
-      else
-        UpdateRowHeaders();
-    }
-    private void Content_ColumnNamesChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Content_ColumnNamesChanged), sender, e);
-      else
-        UpdateColumnHeaders();
-    }
-    private void Content_ItemChanged(object sender, EventArgs<int, int> e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler<EventArgs<int, int>>(Content_ItemChanged), sender, e);
-      else
-        dataGridView.InvalidateCell(e.Value2, e.Value);
-    }
-    private void Content_Reset(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Content_Reset), sender, e);
-      else
-        UpdateData();
-    }
-
-    private Point[] GetSelectedCellsAsPoints() {
-      Point[] points = new Point[dataGridView.SelectedCells.Count];
-      for (int i = 0; i < dataGridView.SelectedCells.Count; i++) {
-        points[i].X = dataGridView.SelectedCells[i].ColumnIndex;
-        points[i].Y = dataGridView.SelectedCells[i].RowIndex;
-      }
-
-      return points;
-    }
-
-    #region TextBox Events
-    private void rowsTextBox_Validating(object sender, CancelEventArgs e) {
-      if (ReadOnly || Locked)
-        return;
-      int i = 0;
-      if (!int.TryParse(rowsTextBox.Text, out i) || (i <= 0)) {
-        e.Cancel = true;
-        errorProvider.SetError(rowsTextBox, "Invalid Number of Rows (Valid values are positive integers larger than 0)");
-        rowsTextBox.SelectAll();
-      }
-    }
-    private void rowsTextBox_Validated(object sender, EventArgs e) {
-      if (!Content.ReadOnly) Content.Rows = int.Parse(rowsTextBox.Text);
-      errorProvider.SetError(rowsTextBox, string.Empty);
-    }
-    private void rowsTextBox_KeyDown(object sender, KeyEventArgs e) {
-      if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
-        rowsLabel.Focus();  // set focus on label to validate data
-      if (e.KeyCode == Keys.Escape) {
-        rowsTextBox.Text = Content.Rows.ToString();
-        rowsLabel.Focus();  // set focus on label to validate data
-      }
-    }
-    private void columnsTextBox_Validating(object sender, CancelEventArgs e) {
-      if (ReadOnly || Locked)
-        return;
-      int i = 0;
-      if (!int.TryParse(columnsTextBox.Text, out i) || (i <= 0)) {
-        e.Cancel = true;
-        errorProvider.SetError(columnsTextBox, "Invalid Number of Columns (Valid values are positive integers larger than 0)");
-        columnsTextBox.SelectAll();
-      }
-    }
-    private void columnsTextBox_Validated(object sender, EventArgs e) {
-      if (!Content.ReadOnly) Content.Columns = int.Parse(columnsTextBox.Text);
-      errorProvider.SetError(columnsTextBox, string.Empty);
-    }
-    private void columnsTextBox_KeyDown(object sender, KeyEventArgs e) {
-      if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
-        columnsLabel.Focus();  // set focus on label to validate data
-      if (e.KeyCode == Keys.Escape) {
-        columnsTextBox.Text = Content.Columns.ToString();
-        columnsLabel.Focus();  // set focus on label to validate data
-      }
-    }
-    #endregion
-
-    #region DataGridView Events
-
-    private void dataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
-      dataGridView.Rows[e.RowIndex].ErrorText = string.Empty;
-    }
-    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
-      if (Content != null && e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
-        int rowIndex = virtualRowIndices[e.RowIndex];
-        e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
-      }
-    }
-
-    private void dataGridView_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e) {
-      this.UpdateRowHeaders();
-    }
-    private void dataGridView_Resize(object sender, EventArgs e) {
-      this.UpdateRowHeaders();
-    }
-
-    private void dataGridView_KeyDown(object sender, KeyEventArgs e) {
-      if (!ReadOnly && e.Control && e.KeyCode == Keys.V)
-        PasteValuesToDataGridView();
-      else if (e.Control && e.KeyCode == Keys.C)
-        CopyValuesFromDataGridView();
-    }
-
-    private void CopyValuesFromDataGridView() {
-      if (dataGridView.SelectedCells.Count == 0) return;
-      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
-      if (addColumnNames) {
-        if (addRowNames)
-          s.Append('\t');
-
-        DataGridViewColumn column = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible);
-        while (column != null) {
-          s.Append(column.HeaderText);
-          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());
-    }
-
-    private string[,] SplitClipboardString(string clipboardText) {
-      if (clipboardText.EndsWith(Environment.NewLine))
-        clipboardText = clipboardText.Remove(clipboardText.Length - Environment.NewLine.Length);  //remove last newline constant
-      string[,] values = null;
-      string[] lines = clipboardText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
-      string[] cells;
-      for (int i = 0; i < lines.Length; i++) {
-        cells = lines[i].Split('\t');
-        if (values == null)
-          values = new string[cells.Length, lines.Length];
-        for (int j = 0; j < cells.Length; j++)
-          values[j, i] = string.IsNullOrEmpty(cells[j]) ? string.Empty : cells[j];
-      }
-      return values;
-    }
-
-    private void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
-      if (Content != null) {
-        if (e.Button == MouseButtons.Left && Content.SortableView) {
-          bool addToSortedIndices = (Control.ModifierKeys & Keys.Control) == Keys.Control;
-          SortOrder newSortOrder = SortOrder.Ascending;
-          if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) {
-            SortOrder oldSortOrder = sortedColumnIndices.Where(x => x.Key == e.ColumnIndex).First().Value;
-            int enumLength = Enum.GetValues(typeof(SortOrder)).Length;
-            newSortOrder = oldSortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), ((((int)oldSortOrder) + 1) % enumLength).ToString());
-          }
-
-          if (!addToSortedIndices)
-            sortedColumnIndices.Clear();
-
-          if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) {
-            int sortedIndex = sortedColumnIndices.FindIndex(x => x.Key == e.ColumnIndex);
-            if (newSortOrder != SortOrder.None)
-              sortedColumnIndices[sortedIndex] = new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder);
-            else
-              sortedColumnIndices.RemoveAt(sortedIndex);
-          } else
-            if (newSortOrder != SortOrder.None)
-              sortedColumnIndices.Add(new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder));
-          Sort();
-        }
-      }
-    }
-
-    protected virtual void ClearSorting() {
-      virtualRowIndices = Enumerable.Range(0, Content.Rows).ToArray();
-      sortedColumnIndices.Clear();
-      UpdateSortGlyph();
-    }
-
-    protected virtual int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {
-      int[] newSortedIndex = Enumerable.Range(0, Content.Rows).ToArray();
-      if (sortedColumns.Count() != 0) {
-        rowComparer.SortedIndices = sortedColumns;
-        rowComparer.Matrix = Content;
-        Array.Sort(newSortedIndex, rowComparer);
-      }
-      return newSortedIndex;
-    }
-    private void UpdateSortGlyph() {
-      foreach (DataGridViewColumn col in this.dataGridView.Columns)
-        col.HeaderCell.SortGlyphDirection = SortOrder.None;
-      foreach (KeyValuePair<int, SortOrder> p in sortedColumnIndices)
-        this.dataGridView.Columns[p.Key].HeaderCell.SortGlyphDirection = p.Value;
-    }
-    #endregion
-
-    public int GetRowIndex(int originalIndex) {
-      return virtualRowIndices[originalIndex];
-    }
-
-    public class RowComparer : IComparer<int> {
-      public RowComparer() {
-      }
-
-      private List<KeyValuePair<int, SortOrder>> sortedIndices;
-      public IEnumerable<KeyValuePair<int, SortOrder>> SortedIndices {
-        get { return this.sortedIndices; }
-        set { sortedIndices = new List<KeyValuePair<int, SortOrder>>(value); }
-      }
-      private IStringConvertibleMatrix matrix;
-      public IStringConvertibleMatrix Matrix {
-        get { return this.matrix; }
-        set { this.matrix = value; }
-      }
-
-      public int Compare(int x, int y) {
-        int result = 0;
-        double double1, double2;
-        DateTime dateTime1, dateTime2;
-        TimeSpan timeSpan1, timeSpan2;
-        string string1, string2;
-
-        if (matrix == null)
-          throw new InvalidOperationException("Could not sort IStringConvertibleMatrix if the matrix member is null.");
-        if (sortedIndices == null)
-          return 0;
-
-        foreach (KeyValuePair<int, SortOrder> pair in sortedIndices.Where(p => p.Value != SortOrder.None)) {
-          string1 = matrix.GetValue(x, pair.Key);
-          string2 = matrix.GetValue(y, pair.Key);
-          if (double.TryParse(string1, out double1) && double.TryParse(string2, out double2))
-            result = double1.CompareTo(double2);
-          else if (DateTime.TryParse(string1, out dateTime1) && DateTime.TryParse(string2, out dateTime2))
-            result = dateTime1.CompareTo(dateTime2);
-          else if (TimeSpan.TryParse(string1, out timeSpan1) && TimeSpan.TryParse(string2, out timeSpan2))
-            result = timeSpan1.CompareTo(timeSpan2);
-          else {
-            if (string1 != null)
-              result = string1.CompareTo(string2);
-            else if (string2 != null)
-              result = string2.CompareTo(string1) * -1;
-          }
-          if (pair.Value == SortOrder.Descending)
-            result *= -1;
-          if (result != 0)
-            return result;
-        }
-        return result;
-      }
-    }
-
-    private void dataGridView_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) {
-      if (Content == null) return;
-      if (e.Button == MouseButtons.Right && Content.ColumnNames.Count() != 0)
-        contextMenu.Show(MousePosition);
-    }
-    protected virtual void ShowHideColumns_Click(object sender, EventArgs e) {
-      new StringConvertibleMatrixColumnVisibilityDialog(this.dataGridView.Columns.Cast<DataGridViewColumn>()).ShowDialog();
-      columnsTextBox.Text = dataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible).ToString();
-    }
-
-    private void UpdateVisibilityOfTextBoxes() {
-      rowsTextBox.Visible = columnsTextBox.Visible = showRowsAndColumnsTextBox;
-      rowsLabel.Visible = columnsLabel.Visible = showRowsAndColumnsTextBox;
-      UpdateDataGridViewSizeAndLocation();
-    }
-
-    private void UpdateVisibilityOfStatisticalInformation() {
-      statisticsTextBox.Visible = showStatisticalInformation;
-      UpdateDataGridViewSizeAndLocation();
-    }
-
-    private void UpdateDataGridViewSizeAndLocation() {
-      int headerSize = columnsTextBox.Location.Y + columnsTextBox.Size.Height +
-       columnsTextBox.Margin.Bottom + dataGridView.Margin.Top;
-
-      int offset = showRowsAndColumnsTextBox ? headerSize : 0;
-      dataGridView.Location = new Point(0, offset);
-
-      int statisticsTextBoxHeight = showStatisticalInformation ? statisticsTextBox.Height + statisticsTextBox.Margin.Top + statisticsTextBox.Margin.Bottom : 0;
-      dataGridView.Size = new Size(Size.Width, Size.Height - offset - statisticsTextBoxHeight);
-    }
-
-
-  }
-    #endregion
-}
