Refreshing datagridview

R

reidarT

I have some fields with a button that adds records to an Access db.
The fields get values from the fieleds.
In the same window I have a datagrid with a list of the same records from
the access db.
When I click the button on the form I want to add records as described above
and then refresh (requery)
the datagrid so I can see the last record added in the datagrid.
I have tried to put
dgvToDo.Refresh()
Me.TblToDoTableAdapter.Fill(Me.DsToDo.tblToDo)
with bo luck

reidarT
 
C

Cor Ligthert [MVP]

Reidar,

I did not try it, but at least would I turn them around, otherwise it makes
not much sense.
The way this code is placed can make the differens is your DsToDo is
renewed, than you need to set the bindings as well.
Me.TblToDoTableAdapter.Fill(Me.DsToDo.tblToDo)
dgvToDo.Refresh()

Cor
 

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