How to set CurrentPageIndex and SelectedItem in a datagrid (webfor

G

Guest

Hi everyone,
Can someone show me how to set the page and row previously selected after
returning from another webpage (within the same application) please.
What I currently have, and I don't know if it can be done better, is a
Search page. Once a search is done, the search criteria is then saved into a
temporary cookie (can't use Cache because it's global and don't want to use
Session because of inprocess problem). The user wants to return to the same
search results after they have selected and viewed a particular record and be
able to select a different one if the previously selected one is not the one
that they want.
The datagrid also has a number of sortable columns and so the sorting also
has to be preserved.
What I currently do is re-query the database everytime the page is reloaded
(not postback).
Please let me know if you require further information. Any suggestion is
always greatly appreciated.
Calvin
 
G

Grant Merwitz

thats a pity, Session's are ideal for you.
But anyway, no crying over spilt milk.

Cookies seems like a viable option, but always risky to leave things client
side.
So, suggestions:

Querystrings?
How secure is what you passing around, could you pass some querystring
values around between pages?

You can try utilizie the Cache as well.
Sure it's global, but each cache item has its own key,
so using this logic, save it in the Cache followed by the users Unique ID.
Maybe set the Cache to be 20 minutes or something short, and just get
renewed if the user is active.

HTH
 
G

Guest

Thanks Grant for your reply. It would be great to use Session variables
wouldn't it.
However, my actual question is: does anyone know how to set the page number
and row previously selected on a datagrid when the user came back to the page?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top