Refreshing datagridview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • reidarT

    #1

    Refreshing datagridview

    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.TblToDoTable Adapter.Fill(Me .DsToDo.tblToDo )
    with bo luck

    reidarT


  • Cor Ligthert [MVP]

    #2
    Re: Refreshing datagridview

    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.TblToDoTable Adapter.Fill(Me .DsToDo.tblToDo )
    dgvToDo.Refresh ()
    Cor

    "reidarT" <reidar@eivon.n oschreef in bericht
    news:edrAMe1nGH A.2432@TK2MSFTN GP03.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.TblToDoTable Adapter.Fill(Me .DsToDo.tblToDo )
    with bo luck
    >
    reidarT
    >

    Comment

    Working...