Displaying current sort indication in the header of a column

E

Eric Caron

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
 
B

Brock Allen

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.
 
E

Eric Caron

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
 

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

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top