title: How to programmatically add rows to DataGrid in C#?
body: <p>So as the title states, I'm trying to add rows to a DataGrid programmatically using C# but I can't seem to make it work. This is what I have so far.</p>
  
  <pre><code>// I have a DataGrid declared as dg in the XAML
  
  foreach (string s in array) {
      int index = 0;
      DataGridRow dgRow = new DataGridRow();
      foreach (DataGridColumn dgColumn in columns)
      {
          // Trying to add Text to dgRow here but IDK how
          index++;
      }
  }
  </code></pre>
  
  <p>I've been googling around and the closest I got to adding anything was to use <code>{column = value}</code> but it just throws me an error. Really out of ideas now though :\</p>