hi there,
i have a ListView on my form. Its 'View' property is set to 'Details' and it has several Column items in its Column Item Collection.
I want the user to be able to click on one of the Column headings and see a little arrow facing down (Sort by ascending order) or an up arrow (Sort by decending) similar to Windows Explorer.
How does one make this little 'arrow' visable to the user
regards,

ListView sorting
Neha Roy
The IComparer requires a type, see below:
internal class ListViewItemComparer:IComparer< >
bryndabella
once again thanks very much for your help, and forgive me for my continued questions, but I have another one:
is there anyway of making the image display to the RIGHT of the column text. At the moment I have an UP and DOWN .bmp in an imagelist and when the user clicks the column it appears. But it appears on the LEFT, I want it to be displayed to the RIGHT of the column text.
e.g.
COLUMN 1 ^ COLUMN 2 COLUMN 3 COLUMN 4
or
COLUMN 1 COLUMN 2 ^
SkiinBlue
Lauski
You might want to take a look on those sites :
http://blog.opennetcf.org/ayakhnin/PermaLink.aspx guid=84e397f0-c273-49b5-ae36-4ee695a644d1
http://www.codeproject.com/cs/miscctrl/lvsortmanager.asp
Reinout
John Childress
Yes thanks.
Sorry to keep bothering you, but what happens if its a date column
Olivier Conq
I do not understand...
i post you all code needed for Listview sorting that I use
Post some code so i could help you with modifications
asics64
you must have ImageList and to maintain them. do not forget to clear all images on columns before set new one.
cristianin_79
Dragan Jankovic
there is good article on CodeProject that describes how to do it:
Based on it I implement it in my project as I have internal class for comparing items
In This class I made changes to compare different columns depeding on their types
and then I attach to Listview.Columnclick event where I have this code
Hope this helps
Zaka Khan
sshetty
I see
Use
System.Collections.IComparer
instead of
System.Collections.Generic.IComparer
Manos Kelaiditis
lets assume in method IComparer.Compare case 3 is dateTime column. then we have this
-Eric Bouguen-
Hi Galin,
Thanks for the help. Is there no way to show the little down arrow and up arrow