How to find which page does a record available in Grid

A

ArunDhaJ

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
 
A

ArunDhaJ

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
 
J

Jim H

ArunDhaJ said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top