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
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