Click here to Skip to main content
13,050,237 members (99,908 online)
Rate this:
Please Sign up or sign in to vote.
Hi i have a gridview contains hundred of records, it is having paging, every page have size 50. now i want to find the first & last row index numbers of the gridview in each paging event.
Posted 3-Aug-12 2:08am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I can't help you through the code, because I have not seen the flow of your coding.In spite of that I can give you a little idea.
Take a hidden field on the page and first time set is to 0. Definitely the last index will be +50 of the first index as you are telling that you are having 50 rows as a time to display. Now in page index changing event of gridview increase your hidden field value to 50.

Finally you got the solution here. The hidden field value will contain the first row index of the current page of entire data and when you'll add 50 to it that will be the last row index of the current page of your entire data.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100