i am trying move to the next record in a row using the score but after entering arecord the cursor moves to another column instead of maintaining the column iam editing
please help
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FormsV2/Site1.Master" CodeBehind="Cursorsample.aspx.vb" Inherits="SMIS2022WEB.Cursorsample" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("[id*=GridView1] input, [id*=GridView1] select").on("keydown", function (e) {
var selector = $(this)[0].tagName;
if (typeof ($(this).attr("type")) != "undefined") {
selector += '[type=' + $(this).attr("type") + ']';
}
if (e.keyCode == 40) {
var next = $(this).closest("tr").next().find(selector);
if (next.length > 0) {
$(this).closest("tr").find('[id*=chkRow]').attr('checked', 'checked');
next.focus();
}
}
if (e.keyCode == 38) {
var prev = $(this).closest("tr").prev().find(selector);
if (prev.length > 0) {
$(this).closest("tr").find('[id*=chkRow]').attr('checked', 'checked');
prev.focus();
}
}
})
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:GridView ID="GridView1" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Id">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Id") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="150px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Country">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Country") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Country") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="150px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Score">
<ItemTemplate>
<asp:TextBox ID="TextBoxb" runat="server" Text='<%# Bind("Score") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Agg">
<ItemTemplate>
<asp:TextBox ID="TextBoxbc" runat="server" Text='<%# Bind("agg") %>' Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Remarks">
<ItemTemplate>
<asp:TextBox ID="TextBoxbcd" runat="server" Text='<%# Bind("Remark") %>' ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tick">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkRow" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#3AC0F2" ForeColor="White"></HeaderStyle>
</asp:GridView>
</asp:Content>
Public Class Cursorsample
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As New DataTable()
dt.Columns.AddRange(New DataColumn(5) {New DataColumn("Id", GetType(Integer)), New DataColumn("Name", GetType(String)), New DataColumn("Country", GetType(String)), New DataColumn("Score", GetType(String)), New DataColumn("Agg", GetType(String)), New DataColumn("Remark", GetType(String))})
dt.Rows.Add(1, "John Hammond", "United States", "80", "2", "Good")
dt.Rows.Add(2, "Mudassar Khan", "India", "84", "2", "Good")
dt.Rows.Add(3, "Suzanne Mathews", "France", "85", "1", "very Good")
dt.Rows.Add(4, "Robert Schidner", "Russia", "80", "2", "Good work")
GridView1.DataSource = dt
GridView1.DataBind()
End If
End Sub
End Class