Thanks for your help people, as luck would have it someone picked up some
code from a site called I think
www.sourcecode.com (?) to fix this. The fix is to convert dates and numbers
into a string sortable format, ie
9 and 100 are set to 009 and 100 and dates converted into longs and the same
approach taken. The original data is stored in the tag of the listitem with
a chr(0) separator, then the sort is performed and the data put back.
Performance seems fine on over 200 items.
We chose not to use the hidden columns as the listviews were configurable
for user preferences at start up, and during a session, so a hidden column
would cause extra work in a number of screens.
Thanks for the api calls to retrieve the item position, I had been
struggling with this for some hours and had to leave it
The thing that I'm still left wondering how to do is to copy the format
over. If I have coloured item one, sort via the api and it now becomes
number 10, the first item in the list still has the same colour as number
one
Whilst I can get the text from the list item what I cant do is to recolour
the list item in its original format
The lvw_item structure does not appear to support colour, any idea as to how
to do this?
Quote:
> Try http://www.mvps.org/vbnet/code/callback/lvsortcallback.htm
> --
> Randy Birch, MVP Visual Basic
> http://www.mvps.org/vbnet/
> http://www.mvps.org/ccrp/
> Please correspond only using the newsgroups so all can benefit.
> | Doing a sort on a list view in vb6 with common controls 6, using the
> winapi
> | call as per the KB article on how to do it using sendmessage and
> | lvm_sortlistitems(?), only trouble is we're using colour coding of
entries
> | in the list view so the text is sorted but not the colour. Does anyone
> know
> | how to get around this, I've looked at the lvwitem structure but theres
no
> | colour property, I cant get an HDC on the list items as far as I'm
aware.
> If
> | I could either get to change the colour directly or get a mapping
between
> | the old and new index of list items that would be fine
> | .
> | Any clues? Thanks in advance
> |
> | --
> | Regards
> | Rob Thomson
> | 0181 690 7030
> |
> |