GridView自动编号

1 protected void GridView1_RowDataBound( object sender,GridViewRowEventArgse)
2 {
3if(e.Row.RowIndex!=-1)
4{
5intid=e.Row.RowIndex+1;
6e.Row.Cells[0].Text=id.ToString();
7}

8}
在GridView中增加了一个自动编号列
可以详细知道当前页一共有多少记录。

你可能感兴趣的:(GridView)