My webform contains a RadGrid that has EditMode set to InPlace. After the webform is rendered, a user can click the edit button on any row within the grid. When edit is clicked, I have a GridTextBoxColumnEditor box that is displayed, which allows the user to edit the cell value. After the value has been changed, the end-user can click the Update button. The code-behind executes radGrid_UpdateCommand, which successfully saves the user’s changes; that all works fine.
In addition to the Update button, however, my users want to be able to simply press the Enter key, and have their changes saved, just as if they had clicked the Update button. How do I get radGrid_UpdateCommand to execute when the Enter key is pressed within the GridTextBoxColumnEditor box?
I was hoping that I could accomplish this objective by simply setting the TextBoxMode property of the GridTextBoxColumnEditor to SingleLine, but there is obviously more to it than that. So how can I get the radGrid_UpdateCommand to execute when a user presses the Enter key in the GridTextBoxColumnEditor box?
Thanks
5 Answers, 1 is accepted

here is a snippet of code decorating a RADnumeric text box which updates when the Enter key is entered
Protected
Sub
rgAddItems_ItemCreated(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
rgAddItems.ItemCreated
Dim
geItem
As
GridEditableItem =
Nothing
Dim
tcPartNumber, tcQty
As
TableCell
Dim
txtPartNumber
As
TextBox
Dim
rntbQty
As
RadNumericTextBox
Dim
btnUpdate
As
LinkButton
Dim
sb
As
StringBuilder =
Nothing
If
e.Item.IsInEditMode
Then
Else
Exit
Sub
End
If
If
TypeOf
e.Item
Is
GridEditableItem
Then
Else
Exit
Sub
End
If
geItem =
DirectCast
(e.Item, GridEditableItem)
tcPartNumber = geItem.Cells(0)
txtPartNumber =
DirectCast
(tcPartNumber.FindControl(
"txtPartNumber"
), TextBox)
btnUpdate =
DirectCast
(geItem.FindControl(
"btnUpdate"
), LinkButton)
tcQty = geItem.Cells(1)
rntbQty = tcQty.FindControl(
"rntbQty"
)
If
rntbQty
Is
Nothing
Then
Else
sb =
New
StringBuilder(
"if(event.which || event.keyCode)"
)
sb.Append(
"{if ((event.which == 13) || (event.keyCode == 13)) "
)
sb.Append(
"{document.getElementById('"
)
sb.Append(btnUpdate.ClientID)
sb.Append(
"').click();return false;}} "
)
sb.Append(
"else {alert(keyCode);return true};"
)
rntbQty.Attributes.Add(
"onkeydown"
, sb.ToString)
End
If
If
TypeOf
e.Item
Is
IGridInsertItem
Then
If
txtPartNumber
Is
Nothing
Then
Else
txtPartNumber.Focus()
End
If
Else
txtPartNumber.
ReadOnly
=
True
rntbQty.Focus()
End
If
End
Sub
<
telerik:RadGrid
ID
=
"rgAddItems"
AutoGenerateColumns
=
"False"
GridLines
=
"Both"
ShowFooter
=
"true"
runat
=
"server"
>
<
MasterTableView
DataKeyNames
=
"PartNumberID"
CommandItemDisplay
=
"Bottom"
NoDetailRecordsText
=
"begin entering data"
runat
=
"server"
>
<
ItemStyle
CssClass
=
"grid_item_style"
/>
<
AlternatingItemStyle
CssClass
=
"grid_alternate_item_style"
/>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"PartNumberID"
DataField
=
"PartNumberID"
Readonly
=
"True"
Visible
=
"False"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"ItemID"
Visible
=
"False"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblItemID"
Text='<%# Bind("ItemID") %>' runat="server" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"PartNumber"
DataField
=
"PartNumber"
HeaderText
=
"Part Number"
ReadOnly
=
"True"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Item Description"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblItemDescription"
Text='<%# Bind("Description") %>' runat="server" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Qty"
DataField
=
"Qty"
HeaderText
=
"Quantity"
/>
<
telerik:GridEditCommandColumn
EditText
=
"Edit"
/>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
/>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
EditColumn
UniqueName
=
"ecColumn"
/>
<
FormTemplate
>
<
table
border
=
"0"
cellpadding
=
"2"
cellspacing
=
"2"
>
<
tr
>
<
td
>
<
asp:HiddenField
ID
=
"hdnPartNumberID"
Value='<%# Bind("PartNumberID") %>' runat="server" />
</
td
>
<
td
>
<
asp:HiddenField
ID
=
"hdnItemID"
Value='<%# Bind("ItemID") %>' runat="server" />
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"body_text_black_BOLD"
>Part Number</
td
>
<
td
>
<
asp:TextBox
ID
=
"txtPartNumber"
Text='<%# Bind("PartNumber") %>' CssClass="body_text_black" runat="server"></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"rfdPartNumber"
ControlToValidate
=
"txtPartNumber"
ErrorMessage
=
"Part Number Required"
runat
=
"server"
/>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"body_text_black_BOLD"
>Quantity</
td
>
<
td
>
<
telerik:RadNumericTextBox
ID
=
"rntbQty"
Text='<%# Bind("Qty") %>' MaxLength="5" MaxValue="9999" MinValue="1" CssClass="body_text_black" runat="server" >
<
NumberFormat
DecimalDigits
=
"0"
/>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ID
=
"rfQty"
ControlToValidate
=
"rntbQty"
ErrorMessage
=
"Quantity required"
runat
=
"server"
>
</
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:LinkButton
ID
=
"btnUpdate"
Text='<%# IIF(TryCast(Container,GridItem).OwnerTableView.IsItemInserted,"Insert","Update") %>' CommandName='<%# IIF(TryCast(Container,GridItem).OwnerTableView.IsItemInserted,"PerformInsert","Update") %>' runat="server" />
</
td
>
<
td
>
<
asp:LinkButton
ID
=
"btnCancel"
Text
=
"Cancel"
CommandName
=
"Cancel"
CausesValidation
=
"false"
runat
=
"server"
/>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
</
telerik:RadGrid
>

Please also check below link.
http://demos.telerik.com/aspnet-ajax/grid/examples/client/keyboardnavigation/defaultcs.aspx
Thanks,
Jayesh Goyani

Thank you so much for your reply. It was exactly what I needed. And the methodology was not complex at all. Simply apply the following RadGrid settings and you are done:
<ClientSettings AllowKeyboardNavigation="true">
<KeyboardNavigationSettings AllowSubmitOnEnter="true" />
</ClientSettings>
Thank you,
Steven


try something like this after the update is completed successfully:
geItem.Edit =
false
;
rgEditOrder.MasterTableView.Rebind();