title: Multiple Binding Source Filters
body: <p>I have a simple database and I'm trying to make it searchable with multiple criteria. What I do not know is how to get the datagridview to filter using these various criteria all together. I'm doing it very messily I know with the if else statements. If I filter with the combobox, it will disregard all my other criteria. Here's my basic code:</p>
  
  <pre><code>if (StartDate &lt; EndDate)
  {
      employeeSuggestionsBindingSource.Filter = string.Format("[Suggestion Date] &gt;= #{0:M/dd/yyyy}# AND [Suggestion Date] &lt;= #{1:M/dd/yyyy}#", StartDate, EndDate);
  }
  else if (string.IsNullOrEmpty(SearchEmp) == false)
  {
      employeeSuggestionsBindingSource.Filter = string.Format("Employee like '%{0}%'", SearchEmp.Trim().Replace("'", "''"));
  }
  else if (string.IsNullOrEmpty(SearchSupv) == false)
  {
      employeeSuggestionsBindingSource.Filter = string.Format("[Supervisor] like '%{0 }%'", SearchSupv.Trim().Replace("'", "''"));
  }
  else if (string.IsNullOrEmpty(SearchAssigned) == false)
  {
      employeeSuggestionsBindingSource.Filter = string.Format("[Assigned To] like '%{0}%'", SearchAssigned.Trim().Replace("'", "''"));
  }
  else if (comboBoxCompleted.Text == "Incomplete")
  {
      employeeSuggestionsBindingSource.Filter = string.Format("[Completed]='False'");
  }
  else if (comboBoxCompleted.Text == "Completed")
  {
      employeeSuggestionsBindingSource.Filter = string.Format("[Completed]='True'");
  }    
  </code></pre>
  
  <p>There has to be a much easier way to filter the results and I know I'm probably doing it in the worst way...ha. </p>