title: Filter a DataGridView without losing unbound changes
body: <p>Im developing a vb.net application and I have a dgv which displays a list of employees. The dgv has an unbound checkbox column which is used in selecting employees for a required action. I use <strong>rowFilter</strong> to filter the list by department or location or whatever the user chooses. </p>
  
  <p>If the user filters using Department 1 and checks the checkboxes next to the employees he wants, to select them and then filters to Department 2, to select a few more employees, when we filter back to Department 1, the checked employees aren't checked any more. </p>
  
  <p>How can I make it such that once an employee is checked, you can filter with other parameters with losing the earlier selections. Im thinking of saving the checked state of each employee to the database before the next filter but I feel is possibly a quicker easier way. Is there?</p>
  
  <p>This is the code I'm using to fill the dgv</p>
  
  <pre><code> sql = "SELECT employee_paysetup.EmployeeNumber AS EmployeeNo, employee_paysetup.FName, employee_paysetup.MName, " _
                  &amp; "employee_paysetup.LName, (case when employee_paysetup.MName = ' ' then concat(employee_paysetup.FName,' ' , employee_paysetup.LName) else " _
                  &amp; "concat(employee_paysetup.FName,' ' , employee_paysetup.MName,' ' , employee_paysetup.LName) end) " _
                  &amp; "AS FullName, costcenters.CostCenterName AS cosName, departments.DepartmentName AS depName, " _
                  &amp; "positions.PositionName AS posName, locations.LocationName AS locName, CostCenter, Department, Position, EmployeeLocation, PayGroup " _
                  &amp; "FROM ((((((employee_paysetup LEFT JOIN employees ON employee_paysetup.EmployeeNumber = employees.EmployeeNumber) " _
                  &amp; "LEFT JOIN costcenters ON employees.CostCenter = costcenters.CostCenterID) " _
                  &amp; "LEFT JOIN departments ON employees.Department = departments.DepartmentID) " _
                  &amp; "LEFT JOIN positions ON employees.Position = positions.PositionID) " _
                  &amp; "LEFT JOIN locations ON employees.EmployeeLocation = locations.LocationID) " _
                  &amp; "LEFT JOIN paygroups ON employee_paysetup.PayGroup = paygroups.ID) " &amp; filterValue
          cmd = New MySqlCommand(sql, conn)
          cmd.Parameters.AddWithValue("@Status", "ACTIVE")
          da.SelectCommand = cmd
          dt.Clear()
          da.Fill(dt)
          'sort
          dt.DefaultView.Sort = "FullName ASC"
          dgvEmployees.DataSource = dt.DefaultView
  </code></pre>
  
  <p>And I filter using</p>
  
  <pre><code>dt.DefaultView.RowFilter  = "myFilter"
  </code></pre>