Listview Autoscroll Problem with dynamic filling

csharp Denmark
  • 14 years ago
    Hi there,

    I'm crunching on this some while allready:

    The view is set to largeicon and when I fill up the list dynamically with items it scrolls always to the last clicked item. I can drag the scrollbar down but after releasing it jumps right back to the item I clicked and puts it on top. The wierd thing is this only happens while adding items to the view. After completion it behaves normal and I can scroll up and down regardless of the item I clicked. I realized it jumps always to the focused item.

    Why do I want that?
    It's a pictureviewer-component. The user klicks on a folder in a TreeView and gets to see its contents as thumbnails. As soon as the user sees the first thumbs rendered he wants to be able to perform at least an "open" operation to view the picture. When the user doubleklicks the item it triggers the opening in another window. After closing it he can go on with another item in the listview. To be able to do so the rendering of the thumbs happens in a separate thread.

    An interesting point is: even if I deselect the just clicked item by clicking in the white space between the thumbs it somehow still has focus since the scrollbar keeps jumping back to it.

    Greetings

    Sven.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++: an octopus made by nailing extra legs onto a dog.” - Steve Taylor