How do I make rowIndex as a sequentially increasing number across all page numbers in the paging gridview?

I have GridView

paginated and each page contains 10 lines. When navigating to the second page ( OnPageIndexChanging

), I want to treat rowIndex as a sequentially increasing number across all page numbers.

For example, if rowindex ends at 9 on page 1, then rowindex must start at 10 for the first row on the next page GridView

.

Any ideas?

+3


source to share


1 answer


The idea is this:



Create indices ViewState

and counts on each page and put the last index in ViewState

.

+1


source







All Articles