title: How to programmatically form an observable collection and bind it to a datagrid
body: <p>I have a problem which i'd divide in two steps:</p>
  
  <p><strong>Problem1.</strong></p>
  
  <p>Form an observable collection of strings and bind it to a datagrid</p>
  
  <pre><code>ObservableCollection&lt;string[]&gt; octest = new ObservableCollection&lt;string[]&gt;();
  var el = new string[6] {"1","2","3", "4", "5", "6" };
  octest.Add(el);
  octest.Add(el);
  octest.Add(el);
  dtgResults.ItemsSource = octest;
  </code></pre>
  
  <p>the problem is that the binding results in the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/FJq37.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJq37.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>Problem 2</strong></p>
  
  <p>The same but now with an array of strings but with mixed elements (e.g. 3 strings and 3 doubles)</p>
  
  <p>thank you</p>
  
  <p>--EDIT-- for CBreeze</p>
  
  <p>I have done that:</p>
  
  <pre><code>  ObservableCollection&lt;TestModel&gt; t = new ObservableCollection&lt;TestModel&gt;();
    var t1 = new TestModel();
    t.Add(t1);
    t.Add(t1);
    t.Add(t1);
    dtgResults.ItemsSource = t;
   }
  }
  
  public class TestModel
  {
    public TestModel()
    {
      TestDouble1 = new string[3];
      TestDouble1[0] = "A";
      TestDouble1[1] = "B";
      TestDouble1[2] = "C";
    }
    public string[] TestDouble1 { get; set; }
  }
  </code></pre>
  
  <p>and the result is:</p>
  
  <p><a href="https://i.stack.imgur.com/yHrfz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yHrfz.png" alt="enter image description here"></a></p>