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

Discussion in 'Bugs & wishlist' started by Rubsanpe, May 7, 2019.

  1. Rubsanpe

    Rubsanpe 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
     

    Attached Files:

    Last edited: May 7, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    Your project uses the old and deprecated CustomListView library. You should switch to xCustomListView.
     
  3. Rubsanpe

    Rubsanpe Member Licensed User

    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
     

    Attached Files:

  4. Erel

    Erel Administrator Staff 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.
     
  5. klaus

    klaus Expert Licensed User

    Add Sleep(0) before calling ScrollToItem.
    Code:
    Sleep(0)
    CustomListView1.ScrollToItem(
    20)
    Why do you use the legacy debugger and not the 'standard' rapid debugger?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    How do you know it? It is not a project setting.
     
  7. Rubsanpe

    Rubsanpe Member Licensed User

    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
     
  8. klaus

    klaus Expert Licensed User

    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.
     
    Erel likes this.
  9. Erel

    Erel Administrator Staff Member Licensed User

    That was my guess.
     
    klaus likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice