Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,

                                    I databinded my entities to a gridview, but when i click my save button on my form (on toolbar), gridview don't post my changes in active editing cell. I have to change the active cell to submit changes to entity. I searched your support center and i found a solution: I created a class (myGridView) that inherits from GridView, and i overrided the OnActiveEditor_ValueChanged method like this:

                                            protected override void OnActiveEditor_ValueChanged(object sender, EventArgs e)
                                            {
                                                base.OnActiveEditor_ValueChanged(sender, e);

                                                BaseEdit edit = sender as BaseEdit;

                                                if (edit != null && this.EditingCell.RowHandle > 0)
                                                {
                                                    this.PostEditor();
                                                    this.UpdateCurrentRow();
                                                }
                                            }

                                    Here is the problem: If my ColumnEdit is TextEdit with FormatString (e.g.: numeric format string "n"), when i edit the cell value, the editor saves changes and formats text immediately. I can't continue to change cell value. I want editor formats cell value when i finish editing the cell. (e.g. when i change the active cell). I sent you a sample project that you can understand my problem completely.

                                    On sample grid, change the income column on which row you want, but don't push enter key or change the cell. The editor formats text and sets my cursor position at start of the string.

                                    How can i make this work?

                                    Thanks.

                                0

                                Hello Selcuk,

                                Thank you for the question. It is not necessary to create your own custom GridView descendant to introduce the necessary functionality. All you need is to post changes within the ButtonClick event handler. I have slightly modified your sample to demonstrate this approach. Please let me know if this approach meet your requirements.

                                Thanks,
                                Stan.

                                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