如何使GridView中模板列的Lable值循环增加

解决方案 »

  1.   

    Try -><asp:label Text='<%# ((GridViewItem)Container).DisplayItemIndex + 1 %>' .....
      

  2.   

    Also Consider -> // field
    protected int _GridViewItemNumber = 0;<asp:label Text='<%# _GridViewItemNumber++ %>' .....
      

  3.   

    循环增加是什么?自增的就用。<%# (Container.DataItemIndex+1).ToString()%> 
      

  4.   

    <asp:Label ID="Label2" runat="server"  
          Text='<%#  Container.ItemIndex+1%>'  >
          </asp:Label>
      

  5.   

    <asp:Label ID="Label1" runat="server"  
        Text='<%#Container.DataItemIndex+1%>'
          </asp:Label>