473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

numbering rows in datagrid

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
Nov 17 '05 #1
2 6200
maybe u should do this at datalevel
there arse some ways i gues u gould do this with dataset events
"buran" <bu***@buran.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
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

Nov 17 '05 #2
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" <bu***@buran.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl... 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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayne Aprato | last post by:
I have a report that shows the results of a query. One of the fields is an autonumber field from the query which shows for instance: 120, 121 , 122 for 3 records. Is there a way to have another...
20
by: Prakash | last post by:
Hi ! I have a field "sub_tran_no" in my form in continuous view. When the user presses a button "Re-Number", I'd like to: 1) Save the current record pointer position 2) Save the current...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
3
by: Carolyn Vo | last post by:
I have a datagrid in my web control class that I am trying to get the current rows displayed for. I have enabled paging on the datagrid so if the user is currently on page 3 of 8, and if I have...
1
by: buran | last post by:
Dear ASP.NET Users, How can I get the total number of rows selected by the command text of the datagrid (items in datagrid)? If I use the statement grdSP.Items.Count with the datagrid grdSP with...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
by: Tim Newton | last post by:
Hi Anyone tell me how to number the rowheaders of a datagrid, e.g. 1,2,3,4,5 etc, just like in excel. I could put the row numbers in a new column but there has to be a simple way of adding it to...
0
by: saraDotNet | last post by:
Hi, I'v Two Questions: 1-Is there a way to make an auto numbering avalible in vb.net form textbox as the one in Access db columns when we set the datatype as autonumbering?? 2- I'm working on a...
0
by: rn5a | last post by:
All the rows in a DataGrid are accompanied by a CheckBox. When a user checks the rows & clicks a Button, the checked rows get deleted. For e.g. assume that the DataGrid displays 10 rows. A user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.