Enter key in RadTextBox in RadGrid

8 posts, 0 answers
  1. Bill
    Bill avatar
    3 posts
    Member since:
    Jan 2011

    Posted 25 Jan 2011 Link to this post

    I have a multi-line RadTextBox in an EditItemTemplate in a RadGrid in a web application.  When the user presses shift-enter, the focus goes to the control in the previous column.  I would like it to behave as if it weren't in a RadGrid: to insert a carriage return and go to the next line in the RadTextBox.  How do I do this?
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 27 Jan 2011 Link to this post

    Hello Bill,

    Do you use the keyboard navigation functionality? Could you please post your code (markup) here?

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    3 posts
    Member since:
    Jan 2011

    Posted 01 Feb 2011 Link to this post

    While trying to boil this down to the least common denominator, I found that my problem has something to do with my master page.
    Using the code below, the enter or shift-enter key takes you to the next control.  If you comment out the master page stuff and uncomment the RadScriptManager it works as advertised.

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="Investments.Test" 
      Title="Maintenance" MasterPageFile="~/Navigation.Master"%> 
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
    <asp:Content ID="Header" ContentPlaceHolderID="cpBody" runat="server">
        <%--<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>--%>
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="dsInstructions" 
                    GridLines="None" AutoGenerateColumns="False" skin="Office2007" >
            <HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>
                <MasterTableView 
                        CommandItemDisplay="Top"
                        DataKeyNames="DeliveryInstructionId" EditMode="InPlace">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            <HeaderStyle Width="10%"/>
                            <ItemStyle HorizontalAlign="Center" /></telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn UniqueName="colInstructions" HeaderText="Instructions" ItemStyle-Wrap="true">
                            <HeaderStyle HorizontalAlign="Center"/>
                            <ItemTemplate>
                                <telerik:RadTextBox BorderStyle="none" style="text-align:left" ReadOnly ="true" runat="server" width="100%" 
                                        ID="tbDealerInstructionsRO" Text = '<%# Bind("Instructions") %>'
                                        TextMode="MultiLine"/>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="tbDealerInstructions" style="text-align:left"  runat="server" 
                                        Text='<%# Bind("Instructions") %>'
                                        TextMode="MultiLine" Wrap="true" Width="400px"
                                        CausesValidation="true">
                                </telerik:RadTextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
               </MasterTableView>
            </telerik:RadGrid>
            <asp:SqlDataSource  ID="dsInstructions" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:InvestmentsConnectionString %>" 
                            SelectCommand="DeliveryInstructions_byDealerForm"/>
    </asp:Content>
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 04 Feb 2011 Link to this post

    Hello Bill,

    I don't see any problem in this code. Can you please post the contents of your master page in this thread?

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Daniel Aquere
    Daniel Aquere avatar
    85 posts
    Member since:
    Mar 2011

    Posted 23 Jun 2011 Link to this post

    Hi guys,

    Sorry my newbie question...

    I have a simple web form, not grid.

    Please, what is necessary to habilitate "Enter key" to go to the next control (move focus) in my web page?

    Thanks, best

    Daniel Aquere
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jun 2011 Link to this post

    Hello Daniel,

    Check out the following forum which discussed the same.
    RadInput KeyPress: change the key pressed.

    Thanks,
    Princy.
  8. Daniel Aquere
    Daniel Aquere avatar
    85 posts
    Member since:
    Mar 2011

    Posted 08 Jul 2011 Link to this post

    Hi Princy,

    Thanks for response, but, the link is broken...

    Daniel
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Jul 2011 Link to this post

    Hi Daniel Aquere,

    Here is the correct link:
    http://www.telerik.com/community/forums/aspnet-ajax/input/onkeypress-change-enter-to-tab.aspx

    Best wishes,
    Pavlina
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017