You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My problem is that the Grid does no update properly when and Filter is active and underlying data changes via DataTable.
I bind DataTable using BindingSource like this:
bindingSource = new BindingSource();
grid.DataSource = bindingSource;
bindingSource.DataSource = dataTable;
I apply a filter on one of the columns (using the built-in menu). Then I delete a row in the dataTable:
dataTable.Rows.RemoveAt(index);
The removed row is not reflected in the Grid. Ie. the grid still shows that row.
Actually, occasionally it does work properly. When it does it's always on the first operation, then it always stops working for subsequent delete operations. Ie: I still see the row in the Grid, even though it has been deleted from the table...
Can you help?
The text was updated successfully, but these errors were encountered:
Hello, I close this as an Issue cause it's not related to the component, it's something related to you BindingSource. I suggest you to build a simple project and work on that.
Take a look at the FAQ, specificaly this here: #16
You are correct and I found the problem on my end. Solution may be useful to others if they run into this:
I was looking for the row to delete in the grid.Rows and taking the index of row to delete. Now, when the rows are filtered, the grid row number does NOT correspond to DataTable row number. I had to look for node to delete in the DataTable and delete it there.
My problem is that the Grid does no update properly when and Filter is active and underlying data changes via DataTable.
I bind DataTable using BindingSource like this:
bindingSource = new BindingSource();
grid.DataSource = bindingSource;
bindingSource.DataSource = dataTable;
I apply a filter on one of the columns (using the built-in menu). Then I delete a row in the dataTable:
dataTable.Rows.RemoveAt(index);
The removed row is not reflected in the Grid. Ie. the grid still shows that row.
Actually, occasionally it does work properly. When it does it's always on the first operation, then it always stops working for subsequent delete operations. Ie: I still see the row in the Grid, even though it has been deleted from the table...
Can you help?
The text was updated successfully, but these errors were encountered: