Reset bindingsource of datagridview does not work

904 views Asked by At

I have a dataset(data.xsd) retrieving data from database, a Bindingsourc(bs) from a table of this data.xsd and a datagridview(dgview) bounded to this bs

now when I insert or delete an item I call the ResetBinding function of bs but the dgview doesn't update by that:

     bs.ResetBinding(false);
     ((BindingSource)dgview.DataSource).ResetBindings(false);

Is there any way to fix that?

1

There are 1 answers

0
Arsalan On BEST ANSWER

I found my problem

the DataSource that I bound the bs to it should get the new data from database and then call ResetBinding() function:

bstableAdapter.Fill(DataTable);
bs.ResetBinding(false);