Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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