Back to the appropriate page in Datagrid

Results 1 to 2 of 2

Thread: Back to the appropriate page in Datagrid

  1. #1
    Join Date
    Dec 1969
    Posts
    6

    Default Back to the appropriate page in Datagrid

    I used default paging for a datagrid with the first column as a HyperLinkColumn. When the link is clicked an edit page is opened where the row&#039;s details are edited. When I click on the Back button of this edit screen, I want the grid to open in the same page where I clicked the link. By default, it goes to the first page of the grid. How do I achieve this? In ASP, we send the page number in the querystring and use the same to get back to the appropriate page. What&#039;s the equivalent in ASP.Net with Datagrid?<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,341

    Default there isnt an equivelent

    as DataGrid depends on form postback<BR><BR>but there is stuff you can do like:<BR>- Pass the page # in querystring thing<BR>- Inside a "Not Page.IsPostBack" block in Page_Load, set the Datagrids ".CurrentPageIndex" to the value from the Querystring (subtract one if needed since the CPI is zero-based)<BR><BR>there is a weird side effect though, your user will consistanly see "Page=X" in the address bar since that will be in the &#060;form&#062;&#039;s action tag

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •