This is a migrated thread and some comments may be shown as answers.

Radgrid Delete Key Behavior

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 10 Sep 2013, 03:12 PM
I recently had a bug reported to me from a customer.  They said they were seeing record getting deleted when they didn't intend to delete them.  In my research, I found the following:

When the user would click the "Edit" icon to edit a particular row, they were able to perform all edit functions.  When they would click on a textbox and hit the "Delete" key on their keyboard, characters within the textbox would be deleted as expected.

When the user would double-click the row to edit it, however, and press of the delete key would remove the row.  Even if they were inside a textbox attempting to delete characters, pressing the delete key would remove the row.

I remedied the situation by disabling double-click editing but would really like to know why pressing the delete key while in double-click edit mode would remove the row, especially if the user was actively editing a textbox.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 13 Sep 2013, 10:59 AM
Hello,

 Normally the grid deletes rows on "Delete" key press only if the keyboard navigation is enabled. You can check if that's the case in your application and disable it if necessary. 
If they keyboard navigation is enabled the grid will also fire a client-side keyPress event that you can handle and prevent the delete action if the cursor is inside the textbox and text editing is expected instead of deleting a record.

Regards,
Marin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Craig
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or