locked
dynamic data gridview - remember row that was edited after update RRS feed

  • Question

  • User-1774892323 posted

    c# - asp.net dynamic data - out of the box routing - list view.

    My gridview has paging enabled displaying 10 rows at a time.

    1) user pages to end of range

    2) User clicks edit on 2nd to last row in the gridview - 98th item in database (100 records).  Edit.aspx page is displayed.  User edits a field.  Clicks Update.  Redirected back to List.aspx page.

    3) List.aspx page displays first page of records again.

    How can we have the page remember which page and record the user was working with?

    Thanks in advance!

    Wednesday, June 13, 2012 3:39 PM

Answers

  • User3866881 posted

    User clicks edit on 2nd to last row in the gridview - 98th item in database (100 records).  Edit.aspx page is displayed.  User edits a field.  Clicks Update.  Redirected back to List.aspx page.

    Well,I think this should be something like a linkbutton or a hyperlink that will guide the client to the Edit.aspx;let's say that suppose this is a LinkButton in the ItemTemplate of your List,So——

    1)Please switch to the design panel and then double click the button in the ItemTemplate;

    2)Then write down this:

    Response.Write("Edit.aspx?id=Your Id from CommandArgument of LinkButton&PageIndex=CurrentPageIndex");

    3)In the end,you can accept that in the Edit.aspx……

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 14, 2012 4:16 AM

All replies

  • User-1336852631 posted
    You could redirect the user to the previous page in the Edit update event.
    Wednesday, June 13, 2012 4:17 PM
  • User3866881 posted

    User clicks edit on 2nd to last row in the gridview - 98th item in database (100 records).  Edit.aspx page is displayed.  User edits a field.  Clicks Update.  Redirected back to List.aspx page.

    Well,I think this should be something like a linkbutton or a hyperlink that will guide the client to the Edit.aspx;let's say that suppose this is a LinkButton in the ItemTemplate of your List,So——

    1)Please switch to the design panel and then double click the button in the ItemTemplate;

    2)Then write down this:

    Response.Write("Edit.aspx?id=Your Id from CommandArgument of LinkButton&PageIndex=CurrentPageIndex");

    3)In the end,you can accept that in the Edit.aspx……

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 14, 2012 4:16 AM