Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Sorting problem in Data grid control

Reply
Thread Tools

Sorting problem in Data grid control

 
 
Sundararajan
Guest
Posts: n/a
 
      04-12-2005
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
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-12-2005
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



> 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,
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you alternate images in a data bound column of a data grid control? C Newby ASP .Net 7 04-02-2004 05:00 PM
How to make the reverse sorting in the data grid? shiv dutta ASP .Net 0 11-19-2003 05:41 AM
sorting in data grid run-time error: Cannot find table 0. Matthew Louden ASP .Net 1 11-18-2003 03:45 AM
sorting in data grid run-time error: Cannot find table 0. Matthew Louden ASP .Net Web Controls 1 11-18-2003 03:45 AM
sorting in data grid run-time error: Cannot find table 0. Matthew Louden ASP .Net 0 11-18-2003 12:57 AM



Advertisments