BindingSource.Filter does not work with affected rows in DataSet

Posted by Artru on Stack Overflow See other posts from Stack Overflow or by Artru
Published on 2010-05-12T12:40:21Z Indexed on 2010/05/12 12:44 UTC
Read the original article Hit count: 249

Filed under:
|
|
|

I created DataGridView in WinForms App. Then at the initializing create DataSet and fill it with some data, bind to DataGridView . I added textBox as a filter. `myBindingSource = new BindingSource();

myBindingSource.DataSource = ds;

myBindingSource.DataMember = dt.TableName;

dataGridView1.DataSource = myBindingSource;` 

   string strCmd = "some filter query";

   myBindingSource.Filter = strCmd;

It works fine with filtering. If I add or delete any row to the DataSet then new data will occur in dridview, BUT filter will not work with new data.

As I found on the forums there is a Table cash, which .NET uses for filter and I want to refresh it. How can I do it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about bindingsource