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

Enter key in RadTextBox in RadGrid

7 Answers 423 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 25 Jan 2011, 06:38 PM
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?

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Jan 2011, 10:32 PM
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.
0
Bill
Top achievements
Rank 1
answered on 01 Feb 2011, 07:21 PM
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>
0
Daniel
Telerik team
answered on 04 Feb 2011, 06:19 PM
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.
0
Daniel Aquere
Top achievements
Rank 2
answered on 23 Jun 2011, 02:57 PM
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
0
Princy
Top achievements
Rank 2
answered on 23 Jun 2011, 03:35 PM
Hello Daniel,

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

Thanks,
Princy.
0
Daniel Aquere
Top achievements
Rank 2
answered on 08 Jul 2011, 07:03 PM
Hi Princy,

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

Daniel
0
Pavlina
Telerik team
answered on 13 Jul 2011, 02:25 PM
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!

Tags
Grid
Asked by
Bill
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Bill
Top achievements
Rank 1
Daniel Aquere
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or