Reputation: 193
How can I Display selected row of Gridview
data to next page in another Gridview
?
For example,
In listing page I want to select particular row and take that data to another page and display over there.
I have two grid view one in 1st page and next one in 2nd page. Now when I select a record in 1st page gridview, than that record will display on 2nd page gridview on submit button click from 1st page.
Upvotes: 1
Views: 2236
Reputation: 50728
Pass the key of the record via the querystring... and then in rowdatabound event, select the row when the data bound record matches the key in the QS.
For more protection, you can use session to store the variable.
Upvotes: 1
Reputation: 9361
Why not have 2 gridviews, one above the other? The top gridview could be made to only show 1 record which is set to the id of the 2nd gridviews selected item identifier in code. Then in 2nd gridview, have an empty selected item template so that the selected item only shows once for both gridviews. That way the 2nd gridview is free to page through the entire set whilst the first retains the selected item for display above?
Upvotes: 0