paging not occuring

S

Sabina

i have placed a datagrid control inside a user control.iam adding the
columns dynamically to the datagrid and populating it with records.to enable
paging i have set allowpaging property to true ,paging mode as NextPrev and
set the nextpage text as next and prevpage text as prev have also added the
pageindexchanged handler.now the problem is if there are two pages when i
click next its going to the pageindexchanged handler and the second page is
loaded now when i click prev without going to the pageindex changed handler

its going to the back page but again when i click next goes to the pageindex
changed handler and an index out of range exception is thrown.i think since
its not going to the pageindex changed handler when i click the prev button
the currentpageindex is not getting decremented so when i go from page 2 to
page1 currentpage index is 1 and when i click next its becoming 2.and if
there are only two page records its an error.
can anyone please suggest a solution to this problem.
regards
sabina
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top