[DevExpress Support Team: CLONED FROM S34255: Core - Support the capability to save all changes automatically (disable all confirmation requests)]
I have a problem AutoRoll back doesn't seem to work in my case, I'm trying to remove the confirmation because I don't want this object to be saved no matter what, I managed to remove save, save and close, save and new buttons but I can't manage to remove the confirmation message. this object is supposed to be like a calculator and it shouldn't be saved, and it inherits persistent class so I can't just make it non persistent.
Visual BasicPartial Public Class UnBindCalculationSheetController
Inherits ViewController
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAction.Active.SetItemValue("Can't Save", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAndNewAction.Active.SetItemValue("Can't Save", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAndCloseAction.Active.SetItemValue("Can't Save", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).ModificationsHandlingMode = ModificationsHandlingMode.AutoRollback
End Sub
Hello Abdelrahman.
If I understand you correctly, you are creating instances of this class to show something in the list view but want these objects never to be saved to the data store. If so, these objects shouldn't be declared as persistent or derive from a persistent class. Refer to the following help topics to learn how to show non-persistent object in XAF list views:
How to: Display a Non-Persistent Object's List View from the Navigation
How to: Display a List of Non-Persistent Objects
Should you need further assistance, please describe your task in greater detail and provide a sample project demonstrating your scenario.
You misunderstood me this class is calculating financial information in the DetailView and it inherites the logic of a persistent class so I had to make this class persistent too and remove save buttons, but I have managed to make it work, somehow when the event OnViewControlsCreated fires it overrides the ModificationHandlingMode to 'confirmation' so I did this to make it work
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
' Perform various tasks depending on the target View.
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAction.Active.SetItemValue("Can't Save", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAndNewAction.Active.SetItemValue("Can't Save", False)
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).SaveAndCloseAction.Active.SetItemValue("Can't Save", False)
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
' Access and customize the target View control.
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.ModificationsController).ModificationsHandlingMode = ModificationsHandlingMode.AutoRollback
End Sub
Thank you.
I'm glad to hear that you've found a solution. However, your original task is still unclear and your solution looks incorrect conceptually. Should you need further assistance, please describe your final task in greater detail.
I will try to explain what I want to do, and if there is a better way than my solution I will be glad.
I attached a picture that explains my goal
And this is the UI of the Calculation Sheet,
Payments are created dynamically in this case and will not be saved in this View,
it will be saved in the Mandate View, this view is just for calculating payments on the fly without saving
Thanks for the update. It still looks like the correct solution here is not to inherit the CalculationSheet class from LeasingFinancial, but to implement it as a non-persitent class. However, images you provided are insufficient to fully understand your task. A detailed description or a sample project would be better.