Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a listview on my form that displays a list of entries from a text file sorted in ascending alphabetical order. If the heading meets certain conditions it displays an image next to it. Double clicking a heading then displays the full contents of that entry. The layout of the entry display screen depends on whether or not the listviewitem (the heading) has an image next to it which is determined by the imageindex being -1 or not.

 

Everytime the listview is accessed, be it on startup or after changing the entries or simply changing views it is reinitialised using the exact same subrountine everytime.

 

On starting the app' the list is displayed correctly with all images in the right places. After editing an entry or changing views the images ARE NOT next to the correct items but the imageindex values for each item ARE correct because on doubleclicking an item I find that the entry display screen is layed out correctly.

 

How can the image end up next to an item with an imageindex of -1?! :confused:

 

This does not happen if I change the sort property of the listview to 'None' but I want it sorted alphabetically.

 

Cheers,

Andy!

I'm getting the hang of this now... No really I am!
  • *Experts*
Posted
Sounds like a bug with the built in ListView sorting routine, to me. It doesn't seem like its sorting the names as well as the image indexes. You might try using a custom ListView item sorter routine and do it yourself.
Posted

Cheers VF,

 

Before I got into custom sorting routines I thought I'd try setting the sort order of the listview to none then initialising the listview and then setting the sort order back to ascending and this seems to have solved the problem.

I'm getting the hang of this now... No really I am!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...