Bug? [SOLVED is not a bug] CustomListView's ScrollToItem function not working for me

Rubsanpe

Active Member
Licensed User
Hi, I'm trying to use CustomListView's ScrollToItem function to move the contents of the list to a new position. It is not working in the latest version of the CustomListView library. I have tested it in the example of the forum that uses the class instead of the library and in that case it works correctly.

Any idea where the problem might be?

I attach an example.

Rubén
 

Attachments

  • CLV_ScrollToItem_Error.zip
    10.3 KB · Views: 289
Last edited:

Rubsanpe

Active Member
Licensed User
Your project uses the old and deprecated CustomListView library. You should switch to xCustomListView.

Thank you for your reply, Erel. I chose badly the library in the example, in my project I am using the correct one. I upload an updated version with the latest version of xCustomListView (1.70)

Rubén
 

Attachments

  • CLV_ScrollToItem_Error2.zip
    10.3 KB · Views: 300

Rubsanpe

Active Member
Licensed User
You are seeing the behavior of the native ScrollView. It's layout is not immediately ready. Add Sleep(0) and it will work. For further discussion please start a new thread in the questions forum.

Thank you Erel. My first tests were putting Sleep in the code but I put it after calling ScrollToItem. Now it's working.

Klaus in the example im using the default debuger options and it is not using the legacy debugger

Thank you for your responses.

Rubén
 

klaus

Expert
Licensed User
Longtime User
How do you know it? It is not a project setting.
I got a message, and thought that it was a project setting and not an IDE setting.
I answered in a thread about the legacy debugger, set it and didn't remove it.
 
Top