No, just don't have a need to "unsort" a ListView!  When a user chooses to
sort a ListView it is because they want to view it in some order that they
choose.  Why the need to "unsort" your view?  Let the user be in control of
how it is sorted.  If you want to revert back to a "how it's stored in the
database order," simply add the record number as a column in your view.
This would allow the user to sort that way as well.

...Glenn

On Mon, Nov 17, 2008 at 6:26 AM, Mike Fry <[EMAIL PROTECTED]> wrote:

>
> Mike Fry wrote:
>
> Using VB.NET <http://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<http://vb.net/>2008 as well as
> VB.NET <http://vb.net/> 2005, that I would have to recourse to an
> OwnerDraw control.
>
> --
> Regards,
> Mike Fry
> Johannesburg.
>

Reply via email to