日期:2014-05-17 浏览次数:20466 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#E3EAEB" /> <Columns> <asp:TemplateField HeaderText="Coulumn1" HeaderStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:TextBox runat="server" ID="txtColumn1" Text='<%# Bind("Column1") %>'></asp:TextBox> </ItemTemplate> <HeaderStyle HorizontalAlign="Left"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderText="Coulumn1" HeaderStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:TextBox runat="server" ID="txtColumn2" Text='<%# Bind("Column2") %>'></asp:TextBox> </ItemTemplate> <HeaderStyle HorizontalAlign="Left"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderText="Coulumn1" HeaderStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:TextBox runat="server" ID="txtColumn3" Text='<%# Bind("Column3") %>'></asp:TextBox> </ItemTemplate> <HeaderStyle HorizontalAlign="Left"></HeaderStyle> </asp:TemplateField> </Columns> <FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True" /> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#7C6F57" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { //For navigating using left and right arrow of the keyboard $("input[type='text'], select").keydown( function (event) { if ((event.keyCode == 39) || (event.keyCode == 9 && event.shiftKey == false)) { var inputs = $(this).parents("form").eq(0).find("input[type='text'], select"); var idx = inputs.index(this); if (idx == inputs.length - 1) { inpu