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.
poogie22Asked:
Who is Participating?
 
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.