views:

36

answers:

1

Hi all,

Need help with technical-designing of a website. I have a main page with a multi-paged grid. Whenever you press on a row, you navigate to an extended details page about this row.

Here comes my question, I want to be able inside the details page to add "Next" and "Prev" buttons according to the original grid. (Mind you, the grid can be filtered and ordered in various ways).

How would you approach this scenario?

Update: We can not work with Session variables since there are scenarios where user moves from a grid, to a details page and then to another grid, and so on... So saving last dataSet in a session varible will be useless.

+1  A: 

You need to create some state to manage your UI workflow. When you display the grid, it is bound to some collection of data. That collection is likely sorted and filtered. Since you will need to reference that data set as part of a larger workflow, you need to either keep the whole (sorted and filtered) collection around (if it is small enough), or keep the criteria that will let you re-query for it (if it is large) in your users session. When you select a row and redirect to the detail page, pass in the selected record in the query string.

Combining the current record from the query string, and the data or criteria stored in the session, you should be able to retrieve the "next" or "previous" record in tandem with what the original data grid displayed. If the user selects Next or Previous, the only requirement would be redirecting to the same page with a different value in the query string for the current record. Since the rest of the criteria or data is in the session, paging through detail pages should be trivial.

jrista
That was exactly what I thought about, but felt crappy about it. Was hoping there is a better way...
Faruz
@Faruz: The controls you might want to use are Gridview and DetailsView. Here's a good sample for a start:http://www.codeproject.com/KB/aspnet/GridViewDetailsView.aspx
o.k.w
Through the use of third party controls, such as Telerik, it can be a lot easier to deal with grid/detail views and paging. However those packaged tend to cost a pretty penny. If a couple grand is cheaper than implementing it yourself, I would say go for it and buy a set of controls that already supports this.
jrista