StrataFrame Forum

Business Binding Source - Undo Changes

http://forum.strataframe.net/Topic7319.aspx

By Tim Dol - 3/6/2007

I have a form with a maintenance form toolstrip and infragistics ultragrid. I am also using a businessbindingsource.

Everything works fine except for the undo button on the toolstrip. When I edit something on the grid and click undo, the value on the grid does not change, however the business object is correct.

I took a look at your new sample program in 1.6 'BusinessBindingSourceExample' and the undo seems to work fine in this example. I looked at the click event and discovered that all you are doing is using 'Undo()', which I assume is what is happening behind the scenes when you click on the undo button on the toolstrip.

As a test, I added a button on my form and executed 'Undo()' in the click event.  This worked fine, so my question is why is the undo button on the toolstrip not working properly? 

Thanks

Tim

By StrataFrame Team - 3/6/2007

Most likely, it has something to do with the grid's row still being in edit mode when you click the undo button.  When you edit the record, the changes within the grid don't get copied back to the business object until the row loses focus.  Try editing the record and then leaving the row and undoing it.
By Tim Dol - 3/6/2007

Thanks Ben, that was my problem. I added some code in the before undo event to end the edit on the grid and it worked fine. Wink
By StrataFrame Team - 3/6/2007

Excellent Smile