CodeSmith Community
Your Code. Your Way. Faster!

Cancelling changes in a subform's datagrid

Latest post 10-24-2006 11:59 AM by michaelloveusa. 4 replies.
  • 10-20-2006 10:00 AM

    Cancelling changes in a subform's datagrid

    Hi there.

     I have a collection of business objects on a form. The user can add/edit/remove these items in a datagrid on a subform. I want to give the user the ability to cancel their changes in the subform and return back to the main form with the collection as it was prior to entering the subform. Is the best way to do this to save a copy of the form prior to calling the subform and revert back if the user cancels? It looks like when I make a copy of the collection, all of the associated flags are not set to what the original collection had. Any thoughts on this issue would be very helpful!

     Thanks, Mike

    • Post Points: 5
  • 10-20-2006 12:26 PM In reply to

    Re: Cancelling changes in a subform's datagrid

    More specifically... 

    I am trying to make a copy of my collection of business objects that I can revert back to if a user discards the changes he/she makes.

    To try to solve this, I have tried to use Copy, Clone and CopyTo a new collection and all of these methods create a new collection that does NOT retain any edits I have made to the collection. Meaning, none of those methods retain which items were new/deleted/changed etc. Is there a way to do this?

    Mike

    • Post Points: 35
  • 10-20-2006 3:30 PM In reply to

    Re: Cancelling changes in a subform's datagrid


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    Filed under: ,
    • Post Points: 35
  • 10-22-2006 1:33 PM In reply to

    Re: Cancelling changes in a subform's datagrid

    Thanks for the response Robert, but I have the same issue with the reference back to the original collection.

    Any other ideas on how I might do this? Could I loop through the original and create an identical collection that refers correctly to any edits/additions/deletions?

     Mike

    • Post Points: 5
  • 10-24-2006 11:59 AM In reply to

    Re: Cancelling changes in a subform's datagrid

    Or is it possible for you to add another clone/copy method that retains state as well as data?

     Let me know and thanks.

    Mike

    • Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems