Unfortunately, that doesn't do it. When I call .RejectChanges, the textbox
but without the hassle of navigating away and back). In other words, I want
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:uqG1iIwYEHA.3128@TK2MSFTNGP09.phx.gbl...
> Call the .RejectChanges method of the underlying dataset if you want to
undo
> everything.
>
> --
> W.G. Ryan MVP Windows - Embedded
>
> Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
> Let Microsoft know!
>
https://www.windowsembeddedeval.com/community/newsgroups > "Gavin Jacobs" <notachance@inhell.net> wrote in message
> news:ubFUrktYEHA.2816@TK2MSFTNGP11.phx.gbl...
> > I have a form bound to a specific row in a table in a dataset. I am
trying
> > to implement Save and Discard buttons. I have the Save button working
> using
> > the DataRowView.EndEdit method. For the Discard button I call
> > DataRowView.CancelEdit. The changes really are canceled, but the user
> input
> > is still there. I can't figure out how to get the Textbox to revert to
the
> > previous value. What's the trick?
> >
> > Here's the code:
> > Private Sub btnPlatformSave_Click(ByVal sender As System.Object,
ByVal
> e
> > As System.EventArgs) Handles btnPlatformSave.Click
> > Dim Row As DataRowView
> > Row = CType(Me.BindingContext(DsData1, "Platform").Current,
> > DataRowView)
> > Row.EndEdit()
> > btnPlatformSave.Enabled = False
> > btnPlatformDiscard.Enabled = False
> > End Sub
> >
> > Private Sub btnPlatformDiscard_Click(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles btnPlatformDiscard.Click
> > Dim Row As DataRowView
> > Row = CType(Me.BindingContext(DsData1, "Platform").Current,
> > DataRowView)
> > Row.CancelEdit()
> > ' Get old values back
> > btnPlatformSave.Enabled = False
> > btnPlatformDiscard.Enabled = False
> > End Sub
> >
> >
>
>