Undo functionality with custom data properties


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
How would I implement undo functionality in a BO for custom data properties? They are read/write and bindable. Specifically, I want my custom properties to undo when BO.undo is called.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, this would depend on what your custom properties are doing.  Are they talking to properties that were created through the BO Mapper?  What are they reading froma nd writing to?  If they are talking to an already built property, the you don't have to do anything because those values will be automatically handled.  If you are talking to another column un the CurrentDataTable, this too will be automatically handled.  If you are talking to a variable or some other value unassociated with the CurrentDataTable, then you will need to handle this yourself in the AfterUndo event.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm talking custom properties, defined in the main BO file (not the BO Mapper generated designer file), with the reflectionpropertydescriptor thingy to get binding to work. I'm reading and writing to another table (not sure its a good idea, but sure is easy BigGrin ) Anyway to get undo (SF undo) to work with these?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you are updating a table other than the internal data table (CurrentDataTable, CurrentRow, CurrentView...take your pick BigGrin ) then you will have to handle this in the AfterUndo method yourself.  If you have an ADO.NET data table just reject the changes:

MyDataTable.RejectChanges()

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK. That's what I needed to known. Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search