Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
Unable to cancel adding new rows with escape key.
posted

If I add a new row to the grid through any means - by using the add button, or by using a template add row (top or bottom) I am unable to cancel adding the new row.

 E.g. I click on the add row to begin editing the row, then I press the escape key because I no longer want to add the row. The row remains in the grid with any changes I have made, and when clicking off the row the IEditableObject.EndEdit is fired, whereas the new object edit should be cancelled when the escape key is pressed.

I've tried using the same binding source with the stock Microsoft DataGridView control and it behaves as expected - i.e. pressing the escape key will cancel adding the new row.

Is there a way that UltraGrid will support using the escape key to cancel adding new rows or do I have to manually intercept the escape key press and manipulate the calls to the bindingsource myself?

Thanks,

 Reeve. 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Reeve,

        Pressing Escape once only cancels the edit in the current cell. You need to press Escape a second time to cancel the entire row.

        If you want to make it so that pressing escape once cancels the entire row, you could modify the grid's KeyActionMappings to do this, I think. You would just have to change the Action on the existing key mapping that cancels the cell and make it cancel the row instead.  

Reply Children