keep selected row in grid view

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    keep selected row in grid view

    On my web form I have a gridview and I allow the user to edit a row but clicking a button above the grid. The Edit button takes them to a edit page with the details of the selected row. When they click 'save' on the Edit page it takes them back to the page.


    How can I have the row they selected to edited remain selected when they come back from the edit page?




  • =?Utf-8?B?U2l2YSBN?=

    #2
    RE: keep selected row in grid view

    Did you try setting GridView.Select edIndex property after save?

    "Mike" wrote:
    On my web form I have a gridview and I allow the user to edit a row but clicking a button above the grid. The Edit button takes them to a edit page with the details of the selected row. When they click 'save' on the Edit page it takes them back to the page.
    >
    >
    How can I have the row they selected to edited remain selected when they come back from the edit page?
    >
    >
    >
    >

    Comment

    • lee whitbeck

      #3
      Re: keep selected row in grid view

      On Aug 10, 11:22 am, Siva M <shiva...@onlin e.excite.comwro te:
      Did you try setting GridView.Select edIndex property after save?
      >
      "Mike" wrote:
      On my web form I have a gridview and I allow the user to edit a row but clicking a button above the grid. The Edit button takes them to a edit page with the details of the selected row. When they click 'save' on the Edit page it takes them back to the page.
      >
      How can I have the row they selected to edited remain selected when they come back from the edit page?
      You will have to store the selected index, so that when they click
      save, and go back to the page you can reset the Index Value. You can
      use a session like below.

      GridView1.Selec tedIndex = (Int32)Session["SelectedGridIn dex"];

      Comment

      Working...