Rebind DataGridView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I catch an error updating a DataGridView using TableAdapter.Update, I
would like to *redisplay* the datagridview as it was before the error. I
guess I don't have this binding source and datagridview thing down yet. I
tried

bindingsource.canceledit and bindingsource.resetbindings(false)

but it's not working. Does anyone know where I might discover how to do this?
 
Hello Dave,

Try resetting the data source itself. If you are bound to a DataTable, you
can invoke the RejectChanges() method of the DataTable.

Regards,

Fritz
 
Thanks Fritz .... that did not work for me. Looking back, I should have
bound to the datatable, but since I have parent/child relationships about 5
deep, I just took the easy way out and dropped the table from the data source
pane on the form. Pay me now or pay me later, I guess :(
 
Back
Top