Editing Data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mfleet1973@yahoo.ca

    #1

    Editing Data

    Hi.

    A datagrid is linked to a dataview. The user double-clicks on the grid
    and the screen changes to a data-input screen. The user makes changes
    and clicks on a button to accept those changes. The code I have for
    this is as follows:

    Try
    If DataSet1.HasCha nges Then
    DataAdapter1.Up date(DataSet1.G etChanges, "Table")
    DataSet1.Accept Changes()
    End If
    Catch x As Exception
    MsgBox(x.Messag e)
    End Try

    Problem is that it never goes into the "If" block even though the
    visual controls are bound to the data fields and user makes changes.
    The program does not seem to detect that changes were made even though
    there were.

    Is there something that I'm doing wrong or missing in my code?

    Many thanks!

    Mike.

  • Cor Ligthert [MVP]

    #2
    Re: Editing Data

    Mike,

    Are you sure that is forever, because the data is pushed down by a rowchange
    in a grid.

    To force that push down, you need for the datagrid the endcurrentedit

    http://msdn2.microsoft.com/en-us/lib...rrentedit.aspx

    I hope this helps,

    Cor

    <mfleet1973@yah oo.caschreef in bericht
    news:1153232338 .159514.232580@ m73g2000cwd.goo glegroups.com.. .
    Hi.
    >
    A datagrid is linked to a dataview. The user double-clicks on the grid
    and the screen changes to a data-input screen. The user makes changes
    and clicks on a button to accept those changes. The code I have for
    this is as follows:
    >
    Try
    If DataSet1.HasCha nges Then
    DataAdapter1.Up date(DataSet1.G etChanges, "Table")
    DataSet1.Accept Changes()
    End If
    Catch x As Exception
    MsgBox(x.Messag e)
    End Try
    >
    Problem is that it never goes into the "If" block even though the
    visual controls are bound to the data fields and user makes changes.
    The program does not seem to detect that changes were made even though
    there were.
    >
    Is there something that I'm doing wrong or missing in my code?
    >
    Many thanks!
    >
    Mike.
    >

    Comment

    Working...