Tabindex is not reaching to lastrow in gridview
<p>**I have Gridview with 2 textbox..i have setted the tab index for 1st texbox of rows...It </p>

<p>is working fine for all of the rows except last row..it is stopping before the last row..</p>

<p>It is not reaching at last row...</p>

<p>plz,help....**    </p>

<pre><code>&lt;asp:GridView ID="GridView1" runat="server"&gt;
                    &lt;AlternatingRowStyle BackColor="White" /&gt;
                    &lt;Columns&gt;
                        &lt;asp:BoundField DataField="st_id" HeaderText="Id" SortExpression="st_id" /&gt;
                        &lt;asp:TemplateField HeaderText="Attended-OutOff"&gt;
                            &lt;ItemTemplate&gt;
                            &lt;table&gt;
                            &lt;tr&gt;
                            &lt;td&gt;
                                &lt;asp:TextBox ID="tbattendedlectures"  runat="server" Height="27px" Width="32px"&gt;&lt;/asp:TextBox&gt;
                                &lt;/td&gt;

                  &lt;td&gt;
                                     &lt;asp:TextBox ID="tbtotalattendence" runat="server" Height="27px" Width="32px" ReadOnly="true"&gt;&lt;/asp:TextBox&gt;
                 &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/table&gt;
                            &lt;/ItemTemplate&gt;
                        &lt;/asp:TemplateField&gt;
                    &lt;/Columns&gt;
                 &lt;/asp:GridView&gt;

    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;

        }


    }
</code></pre>
