Good day, I use a filter on the columns using DataGridViewAutoFilter, tell me how to do it so that after the update the data grid does not get lost.

cn.Open (); BindingSource bsshift = new BindingSource (); DataSet dsshift = new DataSet (); DataTable dtshift = new DataTable ();

dsshift.Tables.Add(dtshift); SqlDataAdapter dashift = new SqlDataAdapter(); dashift = new SqlDataAdapter("запрос", cn); dashift.Fill(dtshift); bsshift.DataSource = dtshift; gridShift.DataSource = bsshift; cn.Close(); for (int i = 0; i < gridShift.RowCount; i++) { if (Convert.ToInt32(gridShift.Rows[i].Cells["planned"].Value) == 1) gridShift.Rows[i].DefaultCellStyle.BackColor = Color.GreenYellow; if (Convert.ToInt32(gridShift.Rows[i].Cells["ErrUpload"].Value) == 1) gridShift.Rows[i].DefaultCellStyle.BackColor = Color.Red; } DataGridViewColumn truck = gridShift.Columns["truck"]; truck.HeaderCell = new DataGridViewAutoFilterColumnHeaderCell(truck.HeaderCell); DataGridViewColumn firstCity = gridShift.Columns["firstCity"]; firstCity.HeaderCell = new DataGridViewAutoFilterColumnHeaderCell(firstCity.HeaderCell 

    0