Pergunta

in XAF I change the CurrentObject of a DetailView with this code :

((DetailView)this.View).CurrentObject = newObject;

When I try to save Object, it tries to save previous object too and validates rules for the previous object. Is there a way to save only the new object?

Foi útil?

Solução

You should be able co call ObjectSpace.Rollback() to abandon the changes to the current object.

However, it would depend what you are trying to achieve, but changing the view's CurrentObject is generally not a good idea. A lot of the context (permissions, available actions, editor visibility , etc.) come from the current object. Better might be to create a separate ObjectSpace with Apllication.CreateObjectSpace() and to make whatever changes you need there.

As with all things DevExpress, the first place to ask is their Support Center

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top