DataGrid和GridView的自動流水號

2010-08-28 10:50:09來源:西部e網(wǎng)作者:

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%>

關(guān)鍵詞:ASP.NET

贊助商鏈接: