Is it possible to Filter a BindingList passed to a bindingsource control:
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0)
{
productBindingSource.Filter = null;
}
else
{
productBindingSource.Filter = "ProductName = '" + textBox1.Text + "'";
//productBindingSource.RemoveFilter();
}
}
Thanks in advance.
Loading
SamioPosted Aug 1, 2012, 9:50 PM
After implementing the BindingList in the project, the next code can be used inside Button click event:
var qry = (from p in dc.Products
select p).ToList();
BindingList
IEnumerable
BindingSource1.DataSource = sel;