Auto Numbering in Datalist

18 views
Skip to first unread message

Meet

unread,
Jan 25, 2011, 12:15:15 AM1/25/11
to DotNetProfessionals-Group
This code explains how to implement auto numbuering in gridview or
datalist in asp.net

jst use <%#Container.ItemIndex +1%> in Datalist as given below

****************
<asp:DataList ID="DataList1" runat="server">
<ItemTemplate>
<div align=left> <table align="left"
cellspacing="1" style="width: 993px">
<tr>
<td class="style2">
<%#Container.ItemIndex + 1 %>

</td>

</tr>

</table></div>
</ItemTemplate>
</asp:DataList>
******************************

For grid use DataItemIndex instead of ItemIndex
Reply all
Reply to author
Forward
0 new messages