title: DataGridVIew populated with anonymous type, how to filter?
body: <p>I've populated a DataGridView with a LINQ query which returns an anonymous type.</p>
  
  <p><em><strong>Question</strong>: any chance to filter the DataGridView whose data source is actually anonymous?</em></p>
  
  <pre><code>// Setting the datagridview data source
  rawDocumentsDataGridView.DataSource = rawTopics
      .SelectMany(t =&gt; t.Documents)
          .Select(d =&gt; new
              {
                 DocumentId = d.Id,
                 Rilevante = d.IsRelevant,
                 TopicId = d.Topic.Id // foreign key
              }).ToList();
  
  // Make it not visibile, waiting for master change
  rawDocumentsDataGridView.Visible = false;
  
  // When master selection changed...
  void rawTopicsDataGridView_SelectionChanged(object sender, System.EventArgs e)
  {
      if (rawTopicsDataGridView.CurrentRow == null) return;
  
      // Get selected topic id
      int tid = (int) rawTopicsDataGridView.CurrentRow.Cells["TopicId"].Value;
  
      // Filter rawDocumentsDataGridView based on topic id
      // WARNING: PSEUDO CODE
      var oldDataSource = (List&lt;AnonymousType&gt;)rawDocumentsDataGridView.DataSource;
      rawDocumentsDataGridView.DataSource = oldDataSource
         .Where(d =&gt; d.TopicId == tid);
  }
  </code></pre>