Search code examples
controllerhidedetailviewxaf

Hide Simple Action Controller When The View Not Yet Saved


I'm new on XAF and actually not so good in english too.

I'm trying to create controller with Simple Action on it. how do i hide this simple action on detailview while the view is new object or the view hasn't been saved.

thanks for your help.


Solution

  • Please note that Object Saving and View Saving are two different things.

    Objects are saved through the Save Action, in a View.

    You can hide a SimpleAction using the ActionBase.TargetObjectsCriteria property, by writing a criterion string that returns false when the object is new.

    A new object check criteria reference can be found here.

    Also, here's a sample code.