I am trying to filter a bindingsource and display it in a datagridview. But it doesn't work. The binding source is filled by a database request Here is my code :
private void SecteurForm_Load(object sender, EventArgs e)
{
_bind.DataSource = _dbPreventif.T_PREVENTIF_COURANT.Where(e => e.PRE_COU_ID_SECTEUR == _idSecteur).ToList();
advancedDataGridView1.DataSource = _bind;
//dataGridView1.CellValueChanged += dataGridView1_CommentChanged;
}
private void button1_Click(object sender, EventArgs e)
{
advancedDataGridView1.DataSource = null;
advancedDataGridView1.Rows.Clear();
_bind.Filter = "PRE_COU_ID = 2339";
advancedDataGridView1.DataSource = _bind;
}
It's working if I add a row but not with the filter. Any idea ? Thanks
it works with a datatable