How to filter datagridview by making any change in the textbox
Using Linq to sql through bindingsource control in WinForms, I could not get this to work:
private void textBox1_TextChanged(object sender, EventArgs e)
{
this.productBindingSource.Filter = string.Format("dataGridViewTextBoxColumn1 like '%{0}%'", textBox1.Text.Trim().Replace("'", "''"));
productDataGridView.DataSource = productBindingSource;
}
When I type some letter in the textbox nothing happens in the datagridview.
Thanks for advices ...