Hierarchial GridEX and N-Level Undo

Hierarchial GridEX and N-Level Undo

Old forum URL: forums.lhotka.net/forums/t/1905.aspx


jschwalm7 posted on Tuesday, December 05, 2006

Hi Guys,

    I'm using version 1.5 of the CLSA framework. I'm having problems with a root object that contains a collection of business objects where each contains two child collections. I'm allowing users to edit all of this info in a hierachial GridEX object (Janus Systems). The problem is apparent after CancelEdit() is invoked the root object (the user cancels changes).   In most cases, there exists 1 or more child or grandchild objects with EditLevel values > 0 after undo when all objects initially began with an EditLevel of 0. The control is invoking IEditableObject.BeginEdit() WITHOUT a complementary call to
either IEditableObject.EndEdit() or IEditableObject.CancelEdit(). This is causing havoc in the object because some of the child objects are completely "undone" whereas others are only partially "undone". I'm curious if anyone else has experienced similar problems with 3rd party controls and how the problem was resolved.

Thanks
Josh

ajj3085 replied on Wednesday, December 06, 2006

I think that the Janis grid behaves badly with data binding.  Search the forum, this has come up before IIRC.

jschwalm7 replied on Friday, December 08, 2006

   I believe I've found a solution to this problem and willing to share if anyone is interested (when I have more time). The out of balance EditLevels stemmed from the fact Janus uses a CurrencyManager for each table in the hierarchy. So far, testing confirms that invoking CancelEdit or EndEdit on each CurrencyManager (obtained through the Form's BindingContext property) used by the GridEX instance coupled w/ a CancelEdit or ApplyEdit on the root object results in a balanced root object after the form exits.

ajj3085 replied on Friday, December 08, 2006

Please do, I'm sure others using the Janus grid have run across this as well.

Copyright (c) Marimer LLC