Home All Groups Group Topic Archive Search About

Sorting problem in Data grid control

Author
12 Apr 2005 9:41 AM
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,
--
S.Sundararajan

Author
12 Apr 2005 3:44 PM
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";

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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,
>

Bookmark and Share