DataGrid和GridView的自动流水号

1.ASP.NET1.1的DataGrid加入一模板列,然后模板列中写如下代码:

<asp:TemplateColumn>

      <ItemTemplate>

       <%# this.DataGrid1.CurrentPageIndex * this.DataGrid1.PageSize + Container.ItemIndex + 1%>

      </ItemTemplate>

     </asp:TemplateColumn>


<asp:TemplateColumn>

 

2.ASP.NET2.0的GridView加入一模板列,然后……:

<%# this.GridView1.CurrentPageIndex * this.GridView1.PageSize + Container.RowIndex + 1%>

posted @ 2006-09-17 20:02  丹心猪(Dansinge)  阅读(450)  评论(2编辑  收藏  举报