When editing in a textbox in a gridcontrol, one has to press 3 times the "ESC" button to leave a dialog.
Steps to Reproduce:
1. new XtraForm
2. place a new button on it (with DialogResult.Cancel set)
3. define the button as CancelButton
4. place a gridcontrol on the form
5. add a datasource on the form an bind it to the gridcontrol
6. display the dialog with "showdialog"
7. start editing the data in the gridcontrol (textedit) by entering some chars
8. press "esc"
--> the inplace editor gets closed
9. press "esc"
10. press "esc"
--> the dialog closes
The row is somehow still in edit mode.
After the step 9 the dialog should get closed.
This XtraGrid behavior is by design.
The first Escape key press closes the active cell editor canceling cell changes.
The second - cancels row changes.
If you need to cancel row editing on the first Escape key press, override the GridView.HideEditor method and call the GridView.CancelUpdateCurrentRow method after the base HideEditor method call. Please refer to the How to create a GridView descendant class and register it for design-time use article.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.