Mike Fry wrote:
Using VB.NET I can readily sort a ListView object on a form by clicking
on a ColumnHeader and provide some visual indication as to the direction
of the sort, a la Explorer.
Two questions arise:-
a) The image, taken from the SmallImageList of the ListView, displays to
the left of the ColumnHeader text. Is there a simple way to get it on
the right?
b) Having sorted the list, I would like to 'unsort' it i.e. return it to
the original order created when it was loaded. I assume that this would
be in item Index order. How do I achieve this?
Okay! No-one wants to talk to me, so I'll talk to myself :-)
Firstly, there was a basic misunderstanding about what constituted an
Item and what constituted a SubItem. I was doing all my sorting on the
various SubItem fields. When I actually attached a value to the Item,
the unsort suddenly started to work!
As for looking like the Explorer sorted columns, I am still unable to
achieve this, and can only conclude having looked in VB.NET 2008 as well
as VB.NET 2005, that I would have to recourse to an OwnerDraw control.
--
Regards,
Mike Fry
Johannesburg.