Is it possible to check if entity is in edit mode? RRS feed

  • Question

  • After entity.BeginEdit has been called and before entity.EndEdit (or entity.CancelEdit) has been called an entity is in an "edit mode". Is it possible to determine from an entity if it is in edit mode or not? This state information should now be kepped in my control although the actual state that is saved as a result of calling BeginEdit is stored in my entity. This becomes problematic if I want to end the edit mode of my entity at another location than where BeginEdit was called.

    The IEditableObject interface does not provide in this. I think this would be a valuable addition.

    Monday, October 11, 2010 7:18 AM

All replies

  • Hi,

    you can use

    (domainDataSource.DataView as IEditableCollectionView).IsEditingItem


    (domainDataSource.DataView as IEditableCollectionView).IsAddingNew

    Monday, October 11, 2010 7:49 AM
  • Thanks for the tip.

    However, I'm not using a  domain data source. I would like to check from the entity itself whether an edit session is active or not (i.e, beginEdit has been called on my entity and has not been ended yet by an invocation of EndEdit or CancelEdit).

    Monday, October 11, 2010 7:58 AM