Rebind DataGridView

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?
 
F

Fritz Francis

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
 
G

Guest

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 :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top