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

                                    how i can cancel the active cell edit mode through code?

                                    currently I'm doing this when valid the active editor:

                                    private void dgvTender_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e)
                                    {
                                          decimal validFormat = 0M;
                                          bool isValidFormat = decimal.TryParse((string)e.Value, out validFormat);
                                          if (!isValidFormat)
                                          {
                                               e.Valid = false;
                                               MessageBox.Show("El monto ingresado no tiene un formato valido",
                                                                           "Monto invalido",
                                                                           MessageBoxButtons.OK,
                                                                           MessageBoxIcon.Error);
                                               return;
                                          }

                                          dgvTender.SetFocusedValue(e.Value);
                                          SendKeys.Send("{ESC}");
                                          TotalizarCobrado();
                                    }

                                    Thanks.

                                0

                                Hi Marvin,

                                Thank you for the question.
                                Use the View's HideEditor method to switch the current View from edit to browse mode.

                                If you need any further assistance on this subject, please feel free to reactivate this ticket.

                                Thanks
                                Dimitros

                                0

                                Hi Dimitros...

                                I was trying but not work, always show the active cell as in edit mode

                                gvFactura.RefreshData();
                                if (gvFactura.IsEditing)
                                {
                                     gvFactura.ActiveEditor.Hide();
                                     gvFactura.HideEditor();
                                     //gvFactura.CloseEditor();
                                }

                                What I doing bad?

                                but, if I try this, work fine

                                if (gvFactura.IsEditing)
                                     SendKeys.Send("{ESC}");

                                0

                                Hi Dimitros,

                                When the GridView have the option OptionsNavigation.EnterMoveTheNextColumn = true when I apply the command CloseEditor () or HideEditor () this does not work, but, when I change this propertie to false worked fine

                                could this be a problem?

                                I need this propertie on true

                                0

                                Hi Marvin,

                                Thank you for the feedback.

                                If I understand you correctly, you wish to prevent a particular grid cell's editor from being invoked after pressing the Enter key. Correct? If so, you can accomplish this task by handling the GridView.ShowingEditor event and setting the e.Cancel property to true, based on a particular condition in this event handler. Please review the How to Conditionally Prevent Editing for Individual Grid Cells help article for more information in this regard.
                                Does this solution meet your requirements? If not, please explain your task in greater detail. It will allow me to help you faster.

                                Thanks,
                                Svetlana

                                0

                                Hi Svetlana.

                                I'm trying to do...
                                I have a form with a gridview the objective the it is that user type a product code in the first cell, when it press the key enter validate the product code and if it exists pass to cell quantity, but, when the cursor pass to cell quantity, the gridview is in edit mode, if i apply the this code: gvFactura.CloseEditor() the gridview always remains in edit mode.

                                Why?... I find that when the property the gridview "OptionsNavigation.EnterMoveNextColumn" is true, the command CloseEditor() is ignored, but works well when it is false

                                Could this be a issue?, or is right to work this way?

                                Apologies if I did not understand right from the start, but do not speak much English.

                                Thanks for you help.

                                0

                                Hi Marvin,

                                Thank you for the feedback.

                                The current behavior is by design.
                                Our documentation states:
                                "The EnterMoveNextColumn option defines the ENTER key behavior when a cell editor is active. If set to false, pressing the ENTER key results in closing the editor saving changes made. Otherwise, the ENTER key press additionally moves focus to the next row cell and activates its editor. Note that focus is moved even if the next cell cannot be edited."
                                So, first, the processed grid's cell is validated, then focus is moved to the next cell, and the corresponding cell's editor is invoked.

                                To accomplish this task, handle the GridView.KeyDown event, as shown in the attached project. Please review the attached project, and let me know if this solution helps you.

                                Thanks,
                                Svetlana

                                Q239627.ZIP
                                0

                                Thanks for you help...

                                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