Hi,
This bug only occurs in this particular combination (that's why I'm attaching a project reproducing the problem). When the ShowViewStrategy.CollectionsEditMode of an ASP.NET Xaf application is set to ViewEditMode.Edit, the Scheduler ASP.NET Module starts behaving oddly.
You must click Edit to be able to add Events when the collections edit mode is set to Edit. Then if you add a New event (in the attached project, to better reflect my own real-world application, I'm using a child of Event, the Work Event - in production it has a LOT of extra properties but it doesn't matter for the problem…) a popup windows will appear and you can add a new Work Event and click OK, which will show you the schedule again with the newly created Work Event there. If you right-click on this newly created event and click Delete, the system processes the request, but after reloading the page, the event was not deleted. I think this is happening because it was not already save in the database (Oid = -1 or the zeroed Guid). If you click in the Save or Save and Close, then you can right-click the event and choose Delete, and it will be deleted correctly.
This is an irritating bug, but not a critical one, as one could simply CANCEL the editing, or SAVE and then proceed with the DELETE, but this is not a definitive answer because sometimes you may add a couple of events before hitting Save, and if you CANCEL you would loose all newly added events, and if you save you will be saving something you don't want saved only to be able to delete it.
Before you apply a fix to this problem in the next release, is there a workaround, maybe a way to write a controller to capture this delete process and only remove the event from the Schedule collection if it is a new object?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Felipe,
Thank you for your report. I have reproduced the problem. We are working on it, and will provide you a solution ASAP.
Thanks,
Anatol
Hello Felipe,
The problem occurs because scheduler events are identified by their IDs, and if there is an unsaved object whose ID is not assigned, it is impossible to get it for deletion. We have introduced a new IDs generation mode to the BaseObject class, that assigns an ID to it when the object is created. This mode can be enabled via the BaseObject.OidInitializationMode static property. It will be available in the DXperience version 10.2.7. Currently, you can implement this yourself by deriving your XPO classes from a custom base class that assigns an ID to an object when it is created (in the AfterConstruction overridden method).
Thanks,
Anatol