Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Displaying current sort indication in the header of a column

Reply
Thread Tools

Displaying current sort indication in the header of a column

 
 
Eric Caron
Guest
Posts: n/a
 
      05-24-2005
Hello all,

Using the .NET framework 1.1, is there a way to do this without too much
coding? I've the got the sorting of my custom columns working both ways (if
I click on the same column, it reverses the sort direction), but I would
like to have an indication of the current sort direction by displaying an
upward or downward pointing arrow. I had it working halfway, but I have no
way of reverting to the original column name if I just concatenate the
header name with a graphic.

Is the best way to save the column header captions on the first page load or
is there a simpler way?

Eric


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-25-2005
You could do it another way, such as adding a Image control into the header
cell that shows the image. Then if the column isn't the one being sorted
you don't add the Image control (or remove the control) from the header cell.

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



> Hello all,
>
> Using the .NET framework 1.1, is there a way to do this without too
> much coding? I've the got the sorting of my custom columns working
> both ways (if I click on the same column, it reverses the sort
> direction), but I would like to have an indication of the current sort
> direction by displaying an upward or downward pointing arrow. I had
> it working halfway, but I have no way of reverting to the original
> column name if I just concatenate the header name with a graphic.
>
> Is the best way to save the column header captions on the first page
> load or is there a simpler way?
>
> Eric
>




 
Reply With Quote
 
 
 
 
Eric Caron
Guest
Posts: n/a
 
      05-26-2005
Thank Brock,

I found a sample that describes a similar technique, where you add a label
control to the cell with a character from the webdings font that represents
an upward or downward arrow (characters 5 and 6 respectively). It seems
that if I add the control in the ItemCreated event, the control is not
preserved between postback, so the header text returns to its default state.
This behaviour is kind of strange to me, but I'm glad it works. =)

Eric

"Brock Allen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> You could do it another way, such as adding a Image control into the

header
> cell that shows the image. Then if the column isn't the one being sorted
> you don't add the Image control (or remove the control) from the header

cell.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > Hello all,
> >
> > Using the .NET framework 1.1, is there a way to do this without too
> > much coding? I've the got the sorting of my custom columns working
> > both ways (if I click on the same column, it reverses the sort
> > direction), but I would like to have an indication of the current sort
> > direction by displaying an upward or downward pointing arrow. I had
> > it working halfway, but I have no way of reverting to the original
> > column name if I just concatenate the header name with a graphic.
> >
> > Is the best way to save the column header captions on the first page
> > load or is there a simpler way?
> >
> > Eric
> >

>
>
>



 
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
Javascript Toolbox - Table Sort utility - Sort on column's @intattribute Rick Javascript 0 06-08-2010 11:44 PM
Sortable column on DataGrid -- column header not displaying Teej ASP .Net Datagrid Control 2 08-15-2006 06:23 PM
Image in header column (not replacing column header text) hansiman ASP .Net Datagrid Control 3 02-07-2004 12:17 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM
Progress indication between pages King Tut ASP .Net 0 08-29-2003 09:42 PM



Advertisments