Current filter:
                                You should refresh the page.
                                  • Description:
                                    I have an XPCollection of objects and use the XtraGrid to edit them. But objects save their state into a database immediately after editing is finished. How can I disable automatic saving and save all the changes explicitly?

                                    Answer:
                                    Applies to:
                                    XPO, XtraGrid
                                    The XPBaseObject class implements the IEditableObject interface, which allows it to interact with the grid-like editors. The default implementation calls the Save method immediately after editing is finished. There are two ways to disable this behavior:

                                    1. Set the static AutoSaveOnEndEdit property of the business class to false.
                                    2. Override the default IEditableObject implementation as shown below:
                                    [C#]
                                    using DevExpress.Xpo; public class Contact : XPObject { ... protected override void BeginEdit() {} protected override void EndEdit() {} protected override void CancelEdit() {} ... }
                                    [VB.NET]
                                    Imports DevExpress.Xpo Public Class Contact Inherits XPObject ... Protected Overrides Sub BeginEdit() End Sub Protected Overrides Sub EndEdit() End Sub Protected Overrides Sub CancelEdit() End Sub ... End Class

                                    The second solution is a bit outdated, and it is better to use the AutoSaveOnEndEdit property.
                                    After these changes are made, it is necessary to directly call the Save method for each modified object to save the changes to the underlying database.
                                    See Also:
                                    2958

                                0 Solutions

                                Creation Date Importance Sort by