473,399 Members | 3,919 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,399 software developers and data experts.

How to find which page does a record available in Grid

Hi All,
I've a grid with say 100 records with pagination of 10 records per
page. Given a record, how can I identify which page does this record
is available?
As the grid size can be much larger than 20K records, looping each
records would be a bad approach. Is there any other way so that I can
find the page number?
Thanks in Advance.
ArunDhaJ
Jul 31 '08 #1
3 1274
int pageNumber = topMostIndex / itemsPerPage;
Jul 31 '08 #2
I wont be having topMostIndex value.

I think u didnt get my query.

Say a grid contains following columns
Name, Age, Department

consider the following record is 12th record
Arun, 22, ComputerScience

through C# code I've to calculate which page does this record with
name "Arun" comes. i.e. Page 2.

I hope I've explained. If you need further clarifications please post
back.

Thanks
ArunDhaJ
Jul 31 '08 #3

"ArunDhaJ" <ar******@gmail.comwrote in message
news:ec**********************************@r15g2000 prd.googlegroups.com...
>I wont be having topMostIndex value.

I think u didnt get my query.

Say a grid contains following columns
Name, Age, Department

consider the following record is 12th record
Arun, 22, ComputerScience

through C# code I've to calculate which page does this record with
name "Arun" comes. i.e. Page 2.

I hope I've explained. If you need further clarifications please post
back.

Thanks
ArunDhaJ
int PageNum = (RecordNumber / RecordsPerPage) + 1;

Given your scenario: PageNum = (12 / 10) + 1
Record appears on Page 2
Aug 2 '08 #4

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

Similar topics

3
by: Oliver Drobnik | last post by:
Hi, I have a datagrid bound to a datatable. Now if I sort the datagrid by clicking on one of the column heads I can no longer use the index in the datagrid to find the corresponding row in the...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
5
by: Peter Rilling | last post by:
I have an interesting issues that, although I not blocking me, is not very performance. Maybe someone can suggest a better way of doing this. 1) I have a page that displays a grid with command...
4
by: Aaron Smith | last post by:
Dim dv As DataView = New DataView(FacilitiesDS1.Facilities, "", "ID ASC", DataViewRowState.CurrentRows) Dim iPos As Integer = dv.Find(dr.Item("ID")) Me.BindingContext(FacilitiesDS1,...
3
by: NuB | last post by:
I have a C# web form that allows the user to perform a search if all the required fields are filled in, which works fine, my issue is if a user does a sucessfull search then enters in data and...
1
by: koren99 | last post by:
Hello, I have a gridview that is filled with a datasource & template fields dynamically. ( that has to be done because i ask the user for a datasource) anyway, i started out creating a static...
3
by: Dave | last post by:
I have an GridView on one page that will open a popup for the selected record. I've been told that there is a way that when the popup record is updated the GridView can be refreshed or Databind. ...
9
by: viktore | last post by:
Hey guys, bad title i know:) Well my problem is as follows: I have a javascript user control, a grid, wich is on an .aspx page. On the grid I can scroll between records, up and down, and click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.