views:

723

answers:

3

How do i set the column which has the header sort glyph, and its direction, in a .NET 2.0 WinForms ListView.

Bump

The listview is .net is not a managed control, it is a very thin wrapper around the Win32 ListView common control. It's not even a very good wrapper - it doesn't expose all the features of the real listview.

The Win32 listview common control supports drawing itself with themes. One of the themed elements is the header sort arrow. Windows Explorer's listview common control knows how to draw one of its columns with that theme element.

a. does the Win32 listview support specifying which column has what sort order? b. does the Win32 header control that the listview internally uses support specifying which column has what sort order? c. does the win32 header control support custom drawing, so i can draw the header sort glyph myself? d. does the win32 listview control support custom header drawing, so i can draw the header sort glyph myself? e. does the .NET ListView control support custom header drawing, so i can draw the header sort glyph myself?

+1  A: 

I use unicode arrow characters in the title of the column and make the header a linkbutton.

DevelopingChris
Could you post an example? This might be helpful to others.
Geoffrey Chetwood
i'd like to know how you change a listview header column into a "linkbutton". i've not heard of a "linkbutton" before.
Ian Boyd
I use unicodes in asp.net. ▼ and ▲
Kb
A: 

There is a listview that I use that has that in-built into it. It's called XPTable..I am digging around my source code to find that helper class that will draw the glyph based on the sort order...This is the code that I have used here..

Hope this helps, Best regards, Tom.

tommieb75