×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to check for changes on the BindingSource and cancel them

How to check for changes on the BindingSource and cancel them

How to check for changes on the BindingSource and cancel them

(OP)
I'm sure this question has been asked and answered a million times, but I've been Googling and can't come up with an answer that works for me...

I've got a bunch of UI controls wired up to a BindingSource.  I've got the databinding set up to update the objects on PropertyChanged.  I need to now implement a "cancel button" - but I can't find any way that works (EndEdit, EndCurrentEdit, CancelEdit, etc.) to roll back the changes - or to even view the old values in the debugger.  I've tried the "BindingSource_CurrentChanged" and "BindingSource_CurrentItemChanged" events with no success - it seems the original values are gone.

I know I could manually create a full copy of the object at the beginning and then create a whole manual compare function - but that seems pretty poor...

Any ideas, please?

Thanks!!!

RE: How to check for changes on the BindingSource and cancel them

(OP)
Slight (but insignificant correction) - the databinding's "Data Source Update Mode" is set to OnValidation, not OnProperyChanged, like I wrote above.

RE: How to check for changes on the BindingSource and cancel them

(OP)
This:
        http://www.pcreview.co.uk/forums/canceledit-bindingsource-t2897605.html
seems to say that I need to implement IEditableObject, which in turn forces me to write my own BeginEdit, EndEdit and CancelEdit.  So that's just an official way of getting this task done manually...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close