protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddl = e.Row.FindControl("txtdes") as DropDownList;
TextBox txt1 = e.Row.FindControl("txtquan") as TextBox;
TextBox txt2 = e.Row.FindControl("ddlDay") as TextBox;
TextBox txt3 = e.Row.FindControl("txtTotal") as TextBox;
int i = e.Row.RowIndex * 4;
ddl.Attributes.Add("tabindex", (i + 1).ToString());
txt1.Attributes.Add("tabindex", (i + 2).ToString());
txt2.Attributes.Add("tabindex", (i + 3).ToString());
txt3.Attributes.Add("tabindex", (i + 4).ToString());
if (e.Row.RowIndex == 0)
ddl.Focus();
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddl = e.Row.FindControl("txtdes") as DropDownList;
TextBox txt1 = e.Row.FindControl("txtquan") as TextBox;
TextBox txt2 = e.Row.FindControl("ddlDay") as TextBox;
TextBox txt3 = e.Row.FindControl("txtTotal") as TextBox;
int i = e.Row.RowIndex * 4;
ddl.Attributes.Add("tabindex", (i + 1).ToString());
txt1.Attributes.Add("tabindex", (i + 2).ToString());
txt2.Attributes.Add("tabindex", (i + 3).ToString());
txt3.Attributes.Add("tabindex", (i + 4).ToString());
if (e.Row.RowIndex == 0)
ddl.Focus();
}
}
No comments:
Post a Comment