62,243
社区成员




protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
var thisTextbox = e.Row.FindControl("txt") as TextBox;
if (thisTextbox != null)
{
if (_lastRow != null)
{
((TextBox)_lastRow.FindControl("txt")).Attributes["onkeydown"] = "if(event.keyCode==13){document.getElementById('" +
thisTextbox.ClientID + "').focus();return false;};";
}
_lastRow = e.Row;
}
}
private GridViewRow _lastRow = null;