Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • in my grid i need to update a table when the RepositoryItemLookUpEdit dropdown is updated. the EditValueChanged fires if the user changes the value, but it does not fire when the user presses ESC to undo. what is the best way to capture cell updates? thank you.

                                0

                                Hi Vince,

                                Thank you for the message.

                                To catch the moment when an end-user clicks the Escape key, handle the GridControl.EditorKeyDown or RepositoryItemLookUpEdit.KeyDown event. To access an active editor and its old edit value, use the GridView.ActiveEditor and BaseEdit.OldEditValue properties respectively.

                                	
                                [VB.NET]
                                Private Sub gridControl1_EditorKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) If e.KeyData = Keys.Escape Then ' End If End Sub

                                Please let me know if you need any further assistance.

                                Thanks,
                                Svetlana

                                0

                                can you please tell me which event is the correct one to use to update a database after the user has updated the RepositoryItemLookUpEdit dropdown? it appears that EditValueChanged is unreliable since it does not fire all the time (for example when the ESC key is pressed). so what is the right way to apply changes only after the user has finished editing and left the editor (only if he made a change)?

                                0

                                Hi Vince,

                                You can handle the GridView.CellValueChanged event . This event is raised after an end-user changes a cell's value and closes an in-place editor (for instance, by focusing another row/column).

                                	
                                [VB.NET]
                                Private Sub gridView1_CellValueChanged(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) If e.Column.FieldName <> "FirstName" Then Return End If ' End Sub

                                Also, you can perform data updates in the GridView.RowUpdated event . This event is raised after the modified focused row is saved to the underlying data source.

                                I recommend that you review the Posting Data to a Connected Database help article, containing useful information in this regard.

                                Please try this approach, and let me know your results.

                                Thanks,
                                Svetlana

                                0

                                ok, thank you. finally, how do i get the old value of the cell before the update took place in the CellValueChanged event?

                                0

                                Hi Vince,

                                Use the GridView.ActiveEditor.OldEditValue property to obtain an old cell's value.

                                Please feel free to contact us in case of any difficulty.

                                Thanks,
                                Svetlana

                                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