C# Tabindex未到达gridview中的最后一行
**我有两个文本框的Gridview..我已经为第一个文本框的行设置了选项卡索引…它 对于除最后一行以外的所有行都正常运行。它在最后一行之前停止 它没有到达最后一排 请帮忙……**C# Tabindex未到达gridview中的最后一行,c#,asp.net,C#,Asp.net,**我有两个文本框的Gridview..我已经为第一个文本框的行设置了选项卡索引…它 对于除最后一行以外的所有行都正常运行。它在最后一行之前停止 它没有到达最后一排 请帮忙……** <asp:GridView ID="GridView1" runat="server"> <AlternatingRowStyle BackColor="White" /> <Columns>
<asp:GridView ID="GridView1" runat="server">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="st_id" HeaderText="Id" SortExpression="st_id" />
<asp:TemplateField HeaderText="Attended-OutOff">
<ItemTemplate>
<table>
<tr>
<td>
<asp:TextBox ID="tbattendedlectures" runat="server" Height="27px" Width="32px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="tbtotalattendence" runat="server" Height="27px" Width="32px" ReadOnly="true"></asp:TextBox>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label batch = (Label)e.Row.FindControl("lbbatch");
batch.Text = dpbatchname.SelectedItem.Text.ToString();
Label subject = (Label)e.Row.FindControl("lbsubject");
subject.Text = dpsubjname.SelectedItem.Text.ToString();
Label sessional = (Label)e.Row.FindControl("lbcurrentsessional");
sessional.Text = dpsessional.SelectedItem.Text.ToString();
TextBox total = (TextBox)e.Row.FindControl("tbtotalattendence");
total.Text = tbnooflecture.Text.ToString();
/* TextBox attendence = (TextBox)e.Row.FindControl("tbattendedlectures");
attendence.Text = tbnooflecture.Text.ToString();
*/
SetTabIndexes();
}
}
private void SetTabIndexes()
{
short currentTabIndex = 0;
GridView1.TabIndex = ++currentTabIndex;
foreach (GridViewRow gvr in GridView1.Rows)
{
TextBox inputField1 = (TextBox)gvr.FindControl("tbattendedlectures");
inputField1.TabIndex = ++currentTabIndex;
}
}