xp

导航

在datagrid中显示行号

Posted on 2007-09-14 15:36  xp  阅读(416)  评论(0编辑  收藏  举报

<asp:DataList ID="dlTeleplayList" runat="server" RepeatColumns="1" RepeatDirection="Horizontal" Width="160">
            <HeaderTemplate>
                <tr>
                    <td height="24" bgcolor="#CDDBF5" class="t3"><img src="images/14.gif" width="16" height="14" align="absmiddle">
                      电视剧排行</td>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>                                    
                  <tr>
                    <td class="c6"></td>
                  </tr>
                  <tr id="myTable">
                    <td height="24" bgcolor="#E4EDFE" class="c7" align="left">&nbsp;&nbsp;&nbsp;<span class="t7"><%#(int)DataBinder.Eval(Container, "itemindex") + 1%></span>&nbsp;&nbsp;&nbsp;<a href="Watch.aspx?strSNO=<%# Eval("ProductSNO") %>" class="a5"><%# Eval("ProductName") %></a></td>
                  </tr>
              
            </ItemTemplate>
        </asp:DataList>

效果:
电影排序:
1                      大话西游
2                      市面埋伏
.                       ......
.                       ......
.                       ......