GridView自动编号可以实现
<asp:TemplateField HeaderText="序号"> 
     <ItemTemplate> 
       <%# (this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize + Container.DataItemIndex + 1%> 
     </ItemTemplate> 
  </asp:TemplateField>可以实现按行1
2
3
4
5
....自动填上序号如何让其倒序呢5
4
3
2
1
等 

解决方案 »

  1.   

    在gridview 的databound 事件里
    int i=6;
    foreach(GridViewRow gvr in GridView1.Rows)
    {
     i--;
    }
      

  2.   

    你这是绑定的数据字段吧,那直接就在SQL语句中desc降序排列就行了
      

  3.   

    <%# this.Pager.PageSize-this.Pager.CurrentPageIndex  %>
    行不行?
      

  4.   


    <%# (this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize + this.Rows.Count - Container.DataItemIndex %> 
      

  5.   


    <%# (this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize + this.Rows.Count - Container.DataItemIndex %>