title: Add new Row to DataTable
body: <p>I have a <code>DataGrid</code> bind to a database with one Table and one Column (FooTable and FooName).
  With my following code, I can bind <code>DataGrid</code> to <code>DataTable</code> and display database data. But when each time I add a new row by <code>DataSet_Add_Click()</code>, nothing gets added to the <code>DataGrid</code>. I though I have bind <code>DataTable</code> to <code>DataGrid</code> through <code>ItemsSource</code>, but adding new row to DataTable doesn't add row to DataGrid. Why?</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      SqlCeConnection conn = new SqlCeConnection();
  
      /* Define the Connection String */
      string connString;
      DataGrid dg1 = new DataGrid();
      DataTable dt = new DataTable();
  
      public MainWindow()
      {
          InitializeComponent();
  
          connString = @"...";
  
          SqlCeConnection conn = new SqlCeConnection(connString);
          conn.Open();
  
          SqlCeDataAdapter da = new SqlCeDataAdapter();
  
          string sqlStr = @"SELECT * FROM FooTable";
          da.SelectCommand = new SqlCeCommand(sqlStr, conn);
  
          DataSet ds = new DataSet();
          da.Fill(ds, "FooTable");
  
          dt = ds.Tables["FooTable"];
  
          dg1.ItemsSource = ds.Tables;
  
          DataRow newRow = dt.NewRow();
          newRow["FooName"] = "Mary";
          dt.Rows.Add(newRow);
  
          CreateDataGrid();
      }
  
      public struct DataItem1
      {
          public string FooName { get; set; }
      }
  
      private void CreateDataGrid()
      {
          DataGridTextColumn col = new DataGridTextColumn();
  
          col = new DataGridTextColumn();
          col.Binding = new Binding("FooName");
          col.Header = "FooName";
          dg1.Columns.Add(col);
  
          /* dataGrid1 exist in XAML and is a parent of the DataGrid */
          dataGrid1.Children.Add(dg1);
      }
  
      private void DataSet_Add_Click(object sender, RoutedEventArgs e)
      {
          DataRow newRow2 = dt.NewRow();
          newRow2["FooName"] = "Mary";
          dt.Rows.Add(newRow2);
      }
  }
  </code></pre>