Check out this code, which will do the work which you wanted
<asp:datagrid id="DataGrid1" runat="server" AllowSorting="True"
AllowCustomPaging="True" AllowPaging="True" PagerStyle-Mode="NumericPages"
PageSize="10" PagerStyle-NextPageText="next" PagerStyle-PrevPageText="Prev"
>
<Columns>
<asp:templatecolumn headertext="Row Number">
<itemtemplate>
<%# DataGrid1.PageSize*DataGrid1.currentPageindex + Container.ItemIndex+1
%>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"buran" <> wrote in message
news:...
> Dear ASP.NET Programmers,
>
>
>
> I am using the datagrid control (grdSPs) to display database data. The
> datagrid allows paging. What I am trying to do is to insert row numbers
> automatically. I can do this, but with every consequent page, the index
> starts again from 1. How can I make it to continue from the row number on
> the previous page?
>
> Thanks in advance,
>
>
>
> Buran
>
>
|