I have a Windows Form program in C#.
I have a dataGridView with several columns and where 2 columns are State and Country
BindingSource bs = new BindingSource();
bs.DataSource = dataGridView1.DataSource;
bs.Filter = "[State] Like '%" + FilterState.Text + "%'" ;
dataGridView1.DataSource = bs;
BindingSource bs = new BindingSource();
bs.DataSource = dataGridView1.DataSource;
bs.Filter = "[Country] Like '%" + FilterCountry.Text + "%'";
dataGridView1.DataSource = bs;
This 2 filters work OK separately, but I also need have both filters active together..
I am trying to make a combination of these 2 filters
bs.Filter = "[State] Like '%" + FilterState.Text + "%'" AND "[Country] Like '%" + FilterCountry.Text + "%'";
But, the line above is not working. How can I do it? Or must I have a totally different approach to ahve multiple filters