• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

datagrid paging problem

cannot return from the last page to a specific page ,it always displays the first page no matter which page is clicked.
0
poogie22
Asked:
poogie22
  • 4
  • 3
1 Solution
 
jeebukarthikeyanCommented:
hi,

u have to add the PageIndexChanged event handler to the datagrid

private void grdAttachments_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
    grdAttachments.CurrentPageIndex = e.NewPageIndex;
    connect2();//function to bind the datagrid
}

b u d d h a
0
 
poogie22Author Commented:
this event handler is already there but it does not fire for the last page
0
 
jeebukarthikeyanCommented:
hi,
have u set any page index in the function which connects datagrid with the value;
check the page load also

b u d d h a
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
poogie22Author Commented:
i have set a page index in the following ,lines
MainWindowGrid.CurrentPageIndex = pageIndex;
but after clicking on any page when i am in the last page the current page index is always 0.
0
 
jeebukarthikeyanCommented:
hi,

where u are assigning val to pageIndex variable

b u d d h a
0
 
poogie22Author Commented:
in page load i have written

PopulateObjects(tabPosition,MainWindowGrid.CurrentPageIndex);
0
 
poogie22Author Commented:
in page load i have written

PopulateObjects(tabPosition,MainWindowGrid.CurrentPageIndex);
but but after clicking on any page when i am in the last page the current page index is always 0.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now