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

RadGrid does not handles the 'Enter' key event on Editing mode

2 Answers 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 22 Mar 2011, 05:20 PM
Hello

Hope you can help, I have a RadGrid defined as follows:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
        GridLines="None"  Skin="Vista" 
        onneeddatasource="RadGrid1_NeedDataSource" ondeletecommand="RadGrid1_DeleteCommand" 
        oninsertcommand="RadGrid1_InsertCommand" 
    onupdatecommand="RadGrid1_UpdateCommand" 
    onitemdatabound="RadGrid1_ItemDataBound" >
      
    <ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="false">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <ClientEvents OnRowDblClick="RowDblClick" />
        <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" />
    </ClientSettings>
    <MasterTableView EditMode="PopUp"  CommandItemDisplay="Bottom">         
        <Columns>
            <telerik:GridBoundColumn  UniqueName="Id" visible="false" ReadOnly="true"
                    DataField="Id" HeaderText="Id" >
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Nombre" AutoPostBackOnFilter="True" 
                    CurrentFilterFunction="Contains" DataField="Nombre" HeaderText="Nombre" 
                    ShowFilterIcon="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn  UniqueName="Precio" AutoPostBackOnFilter="True" 
                    CurrentFilterFunction="Contains" DataField="Precio" HeaderText="Precio" 
                    ShowFilterIcon="False">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn ConfirmText="Borrar este método?" 
                ConfirmTitle="Borrar" ButtonType="ImageButton" CommandName="Delete" 
                Text="Borrar" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow">
                <HeaderStyle Width="30px" />
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                <HeaderStyle Width="30px" />
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
        </Columns>
      
        <CommandItemSettings AddNewRecordText="Añadir nuevo registro" RefreshText="Refrescar" />
        <EditFormSettings EditColumn-CancelText="Cancelar" EditColumn-Display="True" EditFormType="AutoGenerated">
            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
            <FormMainTableStyle GridLines="None" CellSpacing="5" CellPadding="3" BackColor="White" Width="100%" />
            <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" />
            <EditColumn ButtonType="ImageButton"
                InsertText="Guardar" UpdateText="Guardar cambios"
                UniqueName="EditCommandColumn1" CancelText="Cancelar edición" >
            </EditColumn>
            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
            <PopUpSettings Modal="True"></PopUpSettings>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

When I start to edit a row I have a problem, if I try to hit the Enter key, it seems that the focus goes to the delete ImageButton and ask me about confirmation before delete an item.

I have no problems to visualize any data or if I update it with the mouse, with click on the update button. Only when I hit the Enter key while the focus is on editable field.

This behavior not care about the value of the param AllowKeyboardNavigation

Hope you can replicate my problem.
Thank you

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Mar 2011, 01:44 PM
Hello Carlos,

I have tried the same and the issue is not occurring at my end. You can try setting 'AllowSubmitOnEnter' to true (Edit rows upon hitting the [ENTER] key) and see if it eliminates the issue.

ASPX:
<ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="true">
     <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowSubmitOnEnter="true" />
</ClientSettings>

-Shinu.
0
Carlos
Top achievements
Rank 1
answered on 31 Mar 2011, 04:38 PM
I was working with an old version of RadControls, but after update this behaviors continues. Anyway using AllowSubmitOnEnter fix my ploblem :)

Thanks for the help
Tags
Grid
Asked by
Carlos
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Carlos
Top achievements
Rank 1
Share this question
or