StrataFrame Forum

TreeList problem

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

By Alex Bibiano González - 3/30/2008

A have a Devexpress treelist populated with a BO (using BussinessDataSource), and a second BO (the primary Forms BO) and a MaintenanceFormBarManager.

When I edit the BO and click the save button, the treelist FocusedNodeChanged event fires some times before the BO is saved. I use this event to change the primaryBO object and retrieve the BO selected in the tree, therefore, I cant save changes, because before it gets saved, the events fire and change my BO several time.

I have done a workarround checking in the FocusedNodeChanged if the BO is dirty but I think this is a bug or I'm missing something. Why when I click on the MaintenanceFormBarManager Save button, the treelist FocusedNodeChanged is fired?

I have done some test.

If a call the BO.Save() event, all works fine.

If a call the Form.Save() event, the same issue occur (the treelist focusednodechanged event fires). Is this a Devexpress bug?

Thanks,

Alex B.

By StrataFrame Team - 3/31/2008

It's probably in the way the tree is syncing with the CurrencyManager of the BusinessBindingSource.  When you save, a Navigated event might be firing, which will cause the CurrencyManager.CurrentChanged event to fire.  If the tree is listening to this event, then it will likely move the selection to that node and re-raise its event.  Some deep nesting of events is likely what's happening.  However, I don't think the business object raises the Navigated event until after the business object is done saving, so it's a mystery as to exactly what's happening in this case.
By Alex Bibiano González - 4/2/2008

I found my problem. The BO I used to fill the treeview was included in the the list of navigate BO (GetListOfNavigateBOs method). I set the form property IncludeInFormSaveType to PrimaryBusinessObject and all works like a charm.

Thanks

By Trent L. Taylor - 4/2/2008

Glad you found your problem Smile