Sorting problem in Data grid control

S

Sundararajan

Dear Folks,

I am sorting the records in the data grid control. on click of the
header hyper link the record gets sorted. but if i move to the next page, it
shows the unsorted second page; how can i get rid of this.

Thanx in advance.

Regards,
 
B

Brock Allen

You need to "remember" which column was last sorted. Personally I like to
use ViewState for this sort of thing, so that once you leave the page and
go to some other page the column data is gone (as it's not needed anymore).
You can also use Session, but it becomes clumsy, IMO. For ViewState, just
access it directly on your page (just as you would Session).

ViewState["SortColumn"] = "SomeColumnName";
 

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,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top