Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Gridview paging
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 3:08am

1 solution

Rate this: bad
good
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.
 

--Amit
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2014
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