Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I made a very simple sample of a SQLConnexion/SQLDataAdapter/DataSet connected to a SQL Server table. When I edit a record and press on escape, the cell takes the previous value as expected.

                                    Now, when I try to use the CancelEdit button, I don't have the result I expected:
                                    I tought that the CancelEdit button would not only go back in "browse mode" and Cancel all the current changes (like a rollback at record level).
                                    When I try, it doesn't work as expected. So, my question is: What's the real meaning of the CancelEditButton or did I miss something?

                                    Note:
                                    My objective is to make my own list implementing IBindingList with IEditableObject items. All the navigator and grids works perfectly except the CancelEdit... That why I made some test using 'regular' dataset.

                                    Thank you,

                                    Eric

                                0

                                I noticed that the behaviour of the CancelEditButton of the DataNavigator button is different that the CancelEdit button of the embedded navigator (this one seems to work fine)

                                0

                                Hi Eric,

                                If I understand you correctly, you are talking about the standalone DataNavigator's CancelEdit button. If so, the problem is not with the standalone navigator. When you are trying to press the CancelEdit button, the Grid loses focus and as a result posts the current changes to the data source before the Cancel button is pressed. Therefore this button doesn't have any effect. The mentioned button will work correctly only if you are using the standalone DataNavigator along with standalone editors. In the case of using a Grid, you should use the embedded navigator instead.

                                Thanks,
                                Stan.

                                0

                                Great thank you!

                                One related sub-question: Can you tell me what happens in the embedded navigator when the user click on Cancel? (after a validation problem for example). In a ADO connected dataset it undo the changes, (which is natural of course). I mean, what is called. (not the effects)

                                I ask you that because I have implemented my own datasource (as a class implementing IBindingList). The items of my datasource implements IEditableObject. I tought that the Cancel button would call CancelEdit method from the IEditableObject, but it doesn't seems to. So, maybe my implementation is wrong, or I misunderstood something.

                                So, does the cancel button of the embedded calls the methods of the IEditableObject or does it do the "undo" in another way?

                                (I'm writting some Winform Control to be able to use BDS2006 with ECO with the XtraGrids in a nice and easy way).

                                When I edit the cell of a grid and press Cancel, it does undo the changes. But when I have a validation problem (using ValidateRow / Set Column Error and ExceptionMode= ExceptionMode.noAction) and I press on escape the wrong data is well validated and the 'wrong' data is posted.

                                Thank you again,

                                Eric

                                0

                                Hi Eric,

                                When you click the cancel button, the following code is executed (ColumnView.cs - ColumnView.DoNavigatorAction(NavigatorButtonType type) ):

                                HideEditor();
                                CancelUpdateCurrentRow();

                                The CancelUpdateCurrentRow calls the CancelCurrentEdit() method of the underlying CurrencyManager object. After it the data controller calls the CancelEdit method of the corresponding IEditableObject object.
                                Sorry, but I don't quite understand how to replicate the issue. Please review the GridIBindingList tutorial shipped with the installation which demonstrates how to implement this functionality. If it doesn't help, please attach a sample project which demonstrates the issue. I'll review it and try to provide you with an exact solution.

                                Thanks,
                                Stan.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners