I’m using a List View that has 65 items. I’m trying to set the initial position to 45th item.
The first time I select the ListView, it shows from position 1. So I select an item and then select the ListView again and it shows from position 45 as desired.
Why won’t it, or how can I get it to scroll to position 45 initially? I’ve set the position in 3 or 4 places in my codes, no joy.
Any help is greatly appreciated!
You probably need to give the listview time to load everything. Add a clock timer to call the scroll handler after 250 millis (adjust as necessary) to see if that helps…
Yep, that worked. I started the clock timer when I pressed the button, which had to be pressed anyway. When the clock timer method ran, I set the ListView scroll position and the list immediately scrolled to the desired position; worked at 100ms, but I’ll leave it at 250ms.
Thanks for your reply and solution!
Well, it was working. Now I can’t get it to work. Here are
I’ve tried to run the clock before the initVarsMain, no joy.
Set the timer interval BEFORE enabling the timer
Then you can adjust the interval to find the amount of time needed.
1000 msec should be enough.
You may need to do some of this inside your initVarsMain procedure ?
Sorry I didn’t reply earlier.
Setting the timer interval before enabling the timer works way’mo better. Thanks!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.