title: Filter DataGridView from datepicker
body: <p>I have a dataGrid (dataGridView1) in a Windows Form.  dataGridView1 is populated from a business object when the form loads.  That works as expected:</p>
  
  <pre><code>bs.DataSource = oBadger_History.GetChild();
  dataGridView1.AutoGenerateColumns = true;
  dataGridView1.DataSource = bs;
  </code></pre>
  
  <p>I have a dateTimePicker (dateTimePicker1) and on dateTimePicker1_ValueChanged, I want to filter the dataGridView1 results to only show results for the date (v_issue_date) selected in dateTimePicker1.   I have tried the following (using Filter). .but can't seem to get it to work.  Maybe a second pair of eyes will help?  </p>
  
  <pre><code>dateTimePicker1.Format = DateTimePickerFormat.Custom;
  dateTimePicker1.CustomFormat = "M/d/yyyy";
  cs.DataSource = bs.Filter = string.Format("v_issue_date LIKE '{0}%' ",  dateTimePicker1.Text);
  
  dataGridView1.DataSource = cs;
  dataGridView1.Update();
  dataGridView1.Refresh();
  </code></pre>
  
  <p>And please keep in mind that I am relatively new to c#.  I did a search (both here and google) and although there was some good information, it was not directly related to what I am trying to achieve.   </p>
  
  <p>In the above scenario, the DataGridView1 does refresh - but the refresh does not show the filter applied.  </p>
  
  <p>Just to rule out the possibility of a date type mismatch - I made a very simple filter - and still, the DataGridView1 did refresh but did not display filtered data.  </p>
  
  <pre><code>BindingSource cs = new BindingSource();
  
  cs.DataSource = dataGridView1.DataSource;
  cs.Filter = "[v_firstname] = 'Jose'";
  dataGridView1.DataSource = cs;
  dataGridView1.Update();
  dataGridView1.Refresh();
  </code></pre>
  
  <p>These failed attempts mock most of the examples I have seen online . . so I am not sure why the filter does not get applied.</p>
  
  <p>EDIT - *********</p>
  
  <p>Keeping it very simple, I have posted the load and the event below:</p>
  
  <pre><code>private void ChildReport_Load(object sender, EventArgs e)
      {
          //BindingSource bs = new BindingSource();
          bs.DataSource = oBadger_History.GetChild();
          dataGridView1.AutoGenerateColumns = true;
          dataGridView1.DataSource = bs;
      }
  
      private void dateTimePicker1_ValueChanged_1(object sender, EventArgs e)
      {
          bs.Filter = string.Format("v_issue_date = '{0:yyyy/MM/dd}'", dateTimePicker1.Value);
  
          dataGridView1.DataSource = bs.Filter;
          dataGridView1.Update();
          dataGridView1.Refresh();
      }
  </code></pre>
  
  <p>In the above sample, the table refreshes but it always comes back empty.  No Matches found.  Not sure what the issue is.    v_issue_date is a date type field.  I have placed stops in debug and I can verify that the dateTimePicker.Value is in the table.  Not sure why I can't pull a match out.</p>
  
  <p>Edit 2 **********</p>
  
  <p>This is the business object that I use to fill DataGridView1. </p>
  
  <pre><code>public daBindingList&lt;Badger_History&gt; GetChild()
      {
  
          BadgerContext cn = (BadgerContext)this.context;
          var entityKist = cn.Badger_History.Where(b =&gt; b.v_child == "Child").ToList();
          this.EntityList = new daBindingList&lt;Badger_History&gt;(entityKist);
          return this.EntityList;
  
      }
  </code></pre>