title: how to set Row Filtered DataGridView to DataTable in C#
body: <p>I have DataGridview that I filtered some of it's row, I need to save the new datasource to a new DataTable, for some reason my current code don't work, here how I'm trying to convert it.</p>
  
  <pre><code>(LogGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("Type IN({0}) AND Date &gt;= {1} AND Date &lt;= {2} AND Content {3} '%{4}%'", typeFilter, startDate, endDate, likeQuery,keywordFilter.Text);
          this.LogGridView.Sort(this.LogGridView.Columns[0], ListSortDirection.Ascending);
  FilteredTable =  LogGridView.DataSource as DataTable;
  
   public DataTable FilteredTable
      {
          get;
          set;
      }
  </code></pre>
  
  <p>any Idea why it is not working </p>
  
  <p>Thanks</p>