title: Removing rows from dataGridView-using dataTable
body: <p>I am trying to remove all the rows to reload them (I need to remove all rows)  For some reason its not removing them from my datagridview (tho its not adding any extra either) nothing is happening. I have tried many different methods, I know I have done this in the past. (maybe because its end of the day)</p>
  
  <p>Here is my code trying a whole bunch of removes</p>
  
  <pre><code>       private void loadMSXGridView()
      {
          BindingSource bs = new BindingSource();
  
          dgv.DataSource = null;
          dgv.Refresh();
          bs.DataSource = GetTable();
          dgv.DataSource = bs;
          dgv.Columns[0].Width = 391;
          dgv.Columns[1].Width = 30;
      }
  
          private DataTable GetTable()
          {
              DataTable t = new DataTable();
              t.Rows.Clear();
              t.AcceptChanges();
  
              t.Columns.Add("Accounting Line", typeof(string));
              t.Columns.Add("#", typeof(string));
              foreach (AMAPnr.RemarkElement re in AMAPnr._RemarkElements)
              {
                  if (re.ElementID == "RM" &amp;&amp; re.FreeFlow.StartsWith("*MS"))
                  {
                      DataGridViewCell gridCellText;
                      DataGridViewCell gridCellElement;
  
                      gridCellText = new DataGridViewTextBoxCell();
                      gridCellText.Value = re.FreeFlow;
  
                      gridCellElement = new DataGridViewTextBoxCell();
                      gridCellElement.Value = re.ElementNo.ToString();
  
                      t.Rows.Add(gridCellText.Value, gridCellElement.Value);
                  }
              }
              return t;
          }
  </code></pre>
  
  <p>My delete button calls loadMSXGridView, I only need to refresh everything because the items in my datagridview are associated to an element number, which won't remain the same</p>