.NET自带的分页控件代码如下:
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%# Container.DataItemIndex + 1%>
</ItemTemplate>
</asp:TemplateField>

如果自己写的分页类,一次只返回一页的数据,此时的需要就要跟分页的类关联了 :
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%#pgCurrent.PageIndex * pgCurrent.PageSize + Container.DataItemIndex + 1%>
</ItemTemplate>
<ItemStyle Width="5%" />
</asp:TemplateField>

相关文章:

  • 2022-12-23
  • 2021-08-24
  • 2022-01-29
  • 2021-08-21
  • 2021-12-28
  • 2021-08-27
  • 2022-01-10
猜你喜欢
  • 2022-12-23
  • 2021-10-06
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案