title: WPF DataGrid adds rows but not the data (blank rows)
body: <p>Alright so this is going to be hard to explain.</p>
  <p><strong>Scenario:</strong></p>
  <p>I have a DataGrid defined as follows:</p>
  <pre><code>&lt;DataGrid Height=&quot;100&quot; Name=&quot;test&quot; IsReadOnly=&quot;False&quot;&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header=&quot;URL&quot;&gt;&lt;/DataGridTextColumn&gt;
          &lt;DataGridTextColumn Header=&quot;PORT&quot;&gt;&lt;/DataGridTextColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  <p><img src="https://i.stack.imgur.com/X5Wtc.png" alt="data grid visual" /></p>
  <p>It has two headers and I need to add data, I've done a lot of research that suggests using an ObservableCollection since that will fire the DataChanged event.</p>
  <p>I can formulate this data with long boring code that probably isn't relevant (you'll see why below).</p>
  <p><strong>Problem:</strong></p>
  <p>The 200 rows are added but the text itself isn't in the table</p>
  <p><img src="https://i.stack.imgur.com/BQKZL.png" alt="blank rows" /></p>
  <p><strong>Troubleshooting:</strong></p>
  <p>I turned on debugging and with screenshots help, you can see there is actual data but it won't insert it into the rows, but it adds the rows.</p>
  <p><img src="https://i.stack.imgur.com/kQa28.png" alt="Data Collection" /></p>
  <p><strong>Relevant Code:</strong></p>
  <pre><code>ObservableCollection&lt;Proxy&gt; collection = new ObservableCollection&lt;Proxy&gt;();
  collection = GetData(ips,ports);
  test.CanUserAddRows = true;
  test.ItemsSource = null;
  test.ItemsSource = collection;
  MessageBox.Show(&quot;Done&quot;);
  </code></pre>
  <p><strong>NOTE:</strong> I added the .ItemSource = null; and then set it equal to the collection as that enabled the rows to show up. I've tried using the suggested: test.DataContext = collection;
  But, no rows get added at all, and yes just as this test the data is visible in debug mode as being part of the context/itemsource.</p>
  <p><strong>UPDATE:</strong></p>
  <p>I've tried implementing the following XAML with the same results</p>
  <pre><code>&lt;DataGrid Height=&quot;100&quot; Name=&quot;test&quot; IsReadOnly=&quot;False&quot; ItemsSource=&quot;{Binding collection}&quot;&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn Header=&quot;URL&quot; Binding=&quot;{Binding ip}&quot;&gt;&lt;/DataGridTextColumn&gt;
          &lt;DataGridTextColumn Header=&quot;PORT&quot; Binding=&quot;{Binding port}&quot;&gt;&lt;/DataGridTextColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  <p>Proxy Class:</p>
  <pre><code>public class Proxy
  {
      public string ip;
      public string port;
  }
  </code></pre>
  <p><strong>UPDATE 2:</strong> When adding get and set methods the following was my result:</p>
  <p><img src="https://i.stack.imgur.com/yQbEE.png" alt="four columns?" /></p>