Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > numbering rows in datagrid

Reply
Thread Tools

numbering rows in datagrid

 
 
buran
Guest
Posts: n/a
 
      07-07-2003
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


 
Reply With Quote
 
 
 
 
Vincent V
Guest
Posts: n/a
 
      07-07-2003
maybe u should do this at datalevel
there arse some ways i gues u gould do this with dataset events
"buran" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Saravana
Guest
Posts: n/a
 
      07-07-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide/delete rows & the consequent page numbering problem Thomas Kopp ASP .Net Datagrid Control 0 03-01-2007 07:59 PM
numbering rows in datagrid buran ASP .Net 1 10-15-2003 01:54 PM
numbering rows in datagrid buran ASP .Net Web Controls 1 10-15-2003 01:54 PM
numbering rows in datagrid buran ASP .Net Datagrid Control 2 07-07-2003 12:48 PM
numbering rows in datagrid buran ASP .Net 2 07-07-2003 12:48 PM



Advertisments