Setting bindingList.DataSource increments EditLevel

Setting bindingList.DataSource increments EditLevel

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


pmaher posted on Wednesday, December 13, 2006

If  I execute the following code:

   _bsImportPlan = new BindingSource();

   _importPlanList = ImportPlanEditableRootList.GetImportPlanEditableRootList();

   _bsImportPlan.DataSource = _importPlanList;

prior to setting the DataSource, the edit level for _importPlanList is 0

after setting the DataSource, the edit level has been increased to 1.

The data acces routines of the children in the list have the attribute

[Transactional(TransactionalTypes.TransactionScope)].

If I change this to be [Transactional(TransactionalTypes.Manual)] then the edit level does not get incremented when the DataSource is set.

I don't understand why the edit level is being incremented. Is this expected behavior? How do others deal with this?

 

ajj3085 replied on Wednesday, December 13, 2006

Well I would expect that the bindingsource calls begin edit.  That's normal behavior.

The Transactional attribute is only used by the dataportal, and should not be affecting the edit level at all.  It also shouldn't be defined on child objects either (BOs which call MarkAsChild).

Can you post more code? 

Copyright (c) Marimer LLC