This is a migrated thread and some comments may be shown as answers.
RadGrid hit enter anywhere on page fires the Delete command
6 Answers 60 Views
This is a migrated thread and some comments may be shown as answers.
Ray Merckel
Top achievements
Rank 2
Ray Merckel asked on 04 Jan 2010, 05:03 PM

Requirements

RadControls version 2009.1.527.39

 

.NET version

3.5

Visual Studio version

2008

programming language

C# or VB

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
[When there is a RadGrid on a page, if a user hits "Enter" the Delete command from the grid fires... Attached is a javascript function to trap the enter key so that it does not fire the Delete command. Also if you have multi line textboxes and would like to enable the enter key see notes for code behind.]

6 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 05 Jan 2010, 01:37 PM
Hello Ray,

Thank you for the provided code snippets. The behavior you depicted can be observed when you have delete column in the grid and one of the buttons in it happens to be the first submit button on the page when the end user pressed the [ENTER] key from the keyboard.

How to prevent the unwanted delete operation from being triggered you can see from the implementation on this online demo (see the SuppressBubbling javascript method). It seems that you discovered an alternative solution and hence I am converting this thread to a forum post in order to be available for other members from the Telerik community. I also updated your Telerik points for the involvement.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ray Merckel
Top achievements
Rank 2
answered on 05 Jan 2010, 02:44 PM
hello,
i went to your online demo and if you click on the scroll bar, let go of the mouse, and hit the enter key, it still asks you "Are you sure you want to Delete this record?"
thats exactly what i dont want to happen and that is why i posted the code...

thank you
0
Yavor
Telerik team
answered on 08 Jan 2010, 07:26 AM
Hi Ray,

In this case, you can suppress the event bubbling on a page-level. You can assign an onkeydown client side event handler for the whole form, and cancel out the enter key press, when it is not necessary.
Naturally, the approach which you came up initially with, can also be used.
I am sure the community will find one of these approaches useful.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Upender
Top achievements
Rank 1
answered on 30 Nov 2018, 02:23 AM
Hi Team, I am unable to find the SuppressBubbling javascript method in above mentioned demo.
0
Eyup
Telerik team
answered on 04 Dec 2018, 08:05 AM
Hello Upender,

You can use a hidden button to achieve this requirement:
https://www.telerik.com/forums/radgrid-disable-enter-key#KAn1O5APR0SaXfk3MrhL9Q

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Upender
Top achievements
Rank 1
answered on 05 Dec 2018, 07:44 PM
Thanks Eyup. Its working for me :)
Tags
Grid
Asked by
Ray Merckel
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Ray Merckel
Top achievements
Rank 2
Yavor
Telerik team
Upender
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or