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

No client validation on Enter Key

6 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 23 Nov 2012, 03:19 PM
HI, 

I have keybordnavigation enabled on a RadGrid with a  FormTemplate for edition and inserting. I have several radtextbox with requiredfieldvalidators like : 

<telerik:RadTextBox ID="edDescription" runat="server" Text='<%# Bind("PPSO_DESCRIPTION") %>'
           DataType="System.String" Width="277" MaxLength="50"     SelectionOnFocus="SelectAll">                           </telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="edDescription"
              ErrorMessage='<%# GetMessageEx(1744).Texte%>' runat="server" Display="Dynamic" ValidationGroup="freqValid" />

If I click my save button inside the template, the update command is not fired if edDescription is emptym but if I press ENTER key, the server event is fired. My save button looks like : 
<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Add", "Save") %>'     CausesValidation="true" ="server"
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update") %>' ValidationGroup="freqValid">

Is there something to perform validation on Enter key press?

Tom

Update : ok I achived make the validators to work by putting KeyboardNavigationSettings.ValidationGroup = "freqValid", but this only work in update mode, not in insert mode !?!?!

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Nov 2012, 04:32 AM
Hi,

Try setting CausesValidation as false for the RadTextBox.
aspx:
<telerik:RadTextBox ID="edDescription" CausesValidation="false" runat="server"   . . . >
</telerik:RadTextBox>

Thanks,
Shinu.
0
Tommy
Top achievements
Rank 1
answered on 05 Dec 2012, 08:44 PM
Hi,

I tried CauseValidation to false or true, no changes. 

thanks 

Tommy
0
Tommy
Top achievements
Rank 1
answered on 05 Dec 2012, 09:15 PM
Ok heres an update, finally, it's not the Enter key or the click on the button the problem. It's in insert mode. There is no validation on insert, but in update mode, it works well. 

any ideas?
0
Pavlina
Telerik team
answered on 10 Dec 2012, 10:39 PM
Hi,

I tried to reproduce this in our online demo to no avail. Does it work for you there? If yes you may consider implementing the same logic.

Greetings,
Pavlina
the Telerik team
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 their blog feed now.
0
Tommy
Top achievements
Rank 1
answered on 11 Dec 2012, 02:04 PM
Hi

the keyboard navigation is not enabled in this exemple. I need to have keyboard navigation and AllowSubmitOnEnter to true in my case. My first column is a GridButtonColumn with the "Delete" command. If I don't put AllowSubmitOnEnter to true, it tries to delete the first item of the grid each time I press ENTER.

The problem left with my settings is the ENTER keypress in insert mode. ENTER in edit mode does the validation and "save" button click does validation both in edit and insert mode. I really think there is a bug with AllowSubmitOnEnter/Insert mode/validation.

Tom
0
Pavlina
Telerik team
answered on 14 Dec 2012, 06:10 PM
Hi,

Can you provide the RadGrid declaration, so we can test your case locally and advice you further?

Greetings,
Pavlina
the Telerik team
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 their blog feed now.
Tags
Grid
Asked by
Tommy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Tommy
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or