Home All Groups Group Topic Archive Search About

Refreshing datagridview

Author
4 Jul 2006 10:49 AM
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

Author
4 Jul 2006 11:15 AM
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

Show quoteHide quote
"reidarT" <rei***@eivon.no> schreef in bericht
news:edrAMe1nGHA.2432@TK2MSFTNGP03.phx.gbl...
>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
>