AutoInc 行号
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行
{
GridView grid = sender as GridView; //取当前操作的GridView
int rowNo = e.Row.RowIndex+1; //根据行索引加1取行号
e.Row.Cells[0].Text = rowNo.ToString();//设置第一列的值为行号
}
}
乌龟才背着房子过一辈子